From 742d4bff7892ca59fc47ccf5521f89cf78968d65 Mon Sep 17 00:00:00 2001 From: Angus Hollands Date: Tue, 14 Feb 2017 20:46:14 +0000 Subject: [PATCH] Change to iterable as Python3.5 doesn't support Collection. We don't really need the getitem and len attributes anyway --- sanic/router.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sanic/router.py b/sanic/router.py index 4346d39c..94379577 100644 --- a/sanic/router.py +++ b/sanic/router.py @@ -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: