From 377aa5d9205d8b6b236d75e5502152b05211066e Mon Sep 17 00:00:00 2001 From: Nat McLean Date: Fri, 23 Sep 2011 04:10:26 -0300 Subject: fixed config.views.requestonly --- pyramid/config/views.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/pyramid/config/views.py b/pyramid/config/views.py index 703e3cca5..396774035 100644 --- a/pyramid/config/views.py +++ b/pyramid/config/views.py @@ -416,7 +416,7 @@ class DefaultViewMapper(object): def requestonly(view, attr=None): if attr is None: attr = '__call__' - if inspect.isfunction(view): + if inspect.isroutine(view): fn = view elif inspect.isclass(view): try: @@ -436,8 +436,7 @@ def requestonly(view, attr=None): args = argspec[0] - if hasattr(fn, 'im_func'): - # it's an instance method + if inspect.ismethod(fn): if not args: return False args = args[1:] -- cgit v1.2.3