Change to iterable as Python3.5 doesn't support Collection.
We don't really need the getitem and len attributes anyway
This commit is contained in:
parent
b442d78ebb
commit
742d4bff78
|
@ -1,6 +1,6 @@
|
||||||
import re
|
import re
|
||||||
from collections import defaultdict, namedtuple
|
from collections import defaultdict, namedtuple
|
||||||
from collections.abc import Collection
|
from collections.abc import Iterable
|
||||||
from functools import lru_cache
|
from functools import lru_cache
|
||||||
from .exceptions import NotFound, InvalidUsage
|
from .exceptions import NotFound, InvalidUsage
|
||||||
from .views import CompositionView
|
from .views import CompositionView
|
||||||
|
@ -112,8 +112,8 @@ class Router:
|
||||||
self.hosts.add(host)
|
self.hosts.add(host)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
if not isinstance(host, Collection):
|
if not isinstance(host, Iterable):
|
||||||
raise ValueError("Expected either string of Collection of "
|
raise ValueError("Expected either string or Iterable of "
|
||||||
"host strings, not {!r}".format(host))
|
"host strings, not {!r}".format(host))
|
||||||
|
|
||||||
for host_ in host:
|
for host_ in host:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user