summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNat McLean <nmclean64@gmail.com>2011-09-23 04:10:26 -0300
committerNat McLean <nmclean64@gmail.com>2011-09-23 04:10:26 -0300
commit377aa5d9205d8b6b236d75e5502152b05211066e (patch)
treefb8f94653ae8df09cc34049543eb6d9aa2128cd7
parent03ce311ef998239bb76c04baa3cdbe76cc3b3fcf (diff)
downloadpyramid-377aa5d9205d8b6b236d75e5502152b05211066e.tar.gz
pyramid-377aa5d9205d8b6b236d75e5502152b05211066e.tar.bz2
pyramid-377aa5d9205d8b6b236d75e5502152b05211066e.zip
fixed config.views.requestonly
-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:]