aboutsummaryrefslogtreecommitdiffstats
path: root/debug_toolbar/utils/tracking/__init__.py
diff options
context:
space:
mode:
authorAymeric Augustin2013-10-17 09:03:06 +0200
committerAymeric Augustin2013-10-17 18:24:58 +0200
commit06c01648909072aec715535cfa796b58ce287e21 (patch)
tree09b5aa5402901fdc6e8414edb9a692159e7597fd /debug_toolbar/utils/tracking/__init__.py
parent90b1c1c5bafacc4c9967a427224f7ded935bb4a5 (diff)
downloaddjango-debug-toolbar-06c01648909072aec715535cfa796b58ce287e21.tar.bz2
Update introspection code.
Diffstat (limited to 'debug_toolbar/utils/tracking/__init__.py')
-rw-r--r--debug_toolbar/utils/tracking/__init__.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/debug_toolbar/utils/tracking/__init__.py b/debug_toolbar/utils/tracking/__init__.py
index ac00f4c..4fbefa5 100644
--- a/debug_toolbar/utils/tracking/__init__.py
+++ b/debug_toolbar/utils/tracking/__init__.py
@@ -52,10 +52,10 @@ def _replace_function(func, wrapped):
else:
module = import_module(func.__module__)
setattr(module, func.__name__, wrapped)
- elif getattr(func, 'im_self', None):
- setattr(func.im_self, func.__name__, classmethod(wrapped))
+ elif getattr(func, '__self__', None):
+ setattr(func.__self__, func.__name__, classmethod(wrapped))
elif hasattr(func, 'im_class'):
- # for unbound methods
+ # for unbound methods - Python 2 only
setattr(func.im_class, func.__name__, wrapped)
else:
raise NotImplementedError