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 fc0468e..1e6d6cb 100644 --- a/pecan/core.py +++ b/pecan/core.py @@ -254,7 +254,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) |