Browse files

Merge branch 'master' of github.com:tzicatl/pyramid_handlers

  • Loading branch information...
2 parents 892eac4 + 1a91241 commit 491b8a52f01febb025f2972ae8969a29d9d3a9f9 @mcdonc mcdonc committed Mar 12, 2012
Showing with 7 additions and 7 deletions.
  1. +6 −6 pyramid_handlers/__init__.py
  2. +1 −1 pyramid_handlers/tests.py
View
12 pyramid_handlers/__init__.py
@@ -49,12 +49,12 @@ def add_handler(self, route_name, pattern, handler, action=None, **kw):
handler = self.maybe_dotted(handler)
action_decorator = getattr(handler, '__action_decorator__', None)
if action_decorator is not None:
- if hasattr(action_decorator, 'im_self'):
- # instance methods have an im_self == None
- # classmethods have an im_self == cls
- # staticmethods have no im_self
- # instances have no im_self
- if action_decorator.im_self is not handler:
+ if hasattr(action_decorator, '__self__'):
+ # instance methods have an __self__ == None
+ # classmethods have an __self__ == cls
+ # staticmethods have no __self__
+ # instances have no __self__
+ if action_decorator.__self__ is not handler:
raise ConfigurationError(
'The "__action_decorator__" attribute of a handler '
'must not be an instance method (must be a '
View
2 pyramid_handlers/tests.py
@@ -556,7 +556,7 @@ def test_it(self):
from pyramid_handlers import includeme
c = Configurator(autocommit=True)
c.include(includeme)
- self.assertTrue(c.add_handler.im_func.__docobj__ is add_handler)
+ self.assertTrue(c.add_handler.__func__.__docobj__ is add_handler)
class DummyHandler(object): # pragma: no cover
def __init__(self, request):

0 comments on commit 491b8a5

Please sign in to comment.