summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pyramid/config/views.py5
1 files 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:]