Skip to content

Commit

Permalink
change im_self for __self__
Browse files Browse the repository at this point in the history
  • Loading branch information
misaelnieto committed Mar 12, 2012
1 parent fdf6d8b commit 1a91241
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions pyramid_handlers/__init__.py
Expand Up @@ -49,12 +49,12 @@ def add_handler(self, route_name, pattern, handler, action=None, **kw):
handler = self.maybe_dotted(handler) handler = self.maybe_dotted(handler)
action_decorator = getattr(handler, '__action_decorator__', None) action_decorator = getattr(handler, '__action_decorator__', None)
if action_decorator is not None: if action_decorator is not None:
if hasattr(action_decorator, 'im_self'): if hasattr(action_decorator, '__self__'):
# instance methods have an im_self == None # instance methods have an __self__ == None
# classmethods have an im_self == cls # classmethods have an __self__ == cls
# staticmethods have no im_self # staticmethods have no __self__
# instances have no im_self # instances have no __self__
if action_decorator.im_self is not handler: if action_decorator.__self__ is not handler:
raise ConfigurationError( raise ConfigurationError(
'The "__action_decorator__" attribute of a handler ' 'The "__action_decorator__" attribute of a handler '
'must not be an instance method (must be a ' 'must not be an instance method (must be a '
Expand Down

0 comments on commit 1a91241

Please sign in to comment.