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:
Angus Hollands 2017-02-14 20:46:14 +00:00
parent b442d78ebb
commit 742d4bff78

View File

@ -1,6 +1,6 @@
import re
from collections import defaultdict, namedtuple
from collections.abc import Collection
from collections.abc import Iterable
from functools import lru_cache
from .exceptions import NotFound, InvalidUsage
from .views import CompositionView
@ -112,8 +112,8 @@ class Router:
self.hosts.add(host)
else:
if not isinstance(host, Collection):
raise ValueError("Expected either string of Collection of "
if not isinstance(host, Iterable):
raise ValueError("Expected either string or Iterable of "
"host strings, not {!r}".format(host))
for host_ in host: