diff options
Diffstat (limited to 'pecan/core.py')
-rw-r--r-- | pecan/core.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/pecan/core.py b/pecan/core.py index 934931a..20d6403 100644 --- a/pecan/core.py +++ b/pecan/core.py @@ -255,7 +255,8 @@ class PecanBase(object): module = __import__(name, fromlist=fromlist) kallable = getattr(module, parts[-1]) msg = "%s does not represent a callable class or function." - assert hasattr(kallable, '__call__'), msg % item + if not six.callable(kallable): + raise TypeError(msg % item) return kallable() raise ImportError('No item named %s' % item) |