aboutsummaryrefslogtreecommitdiffstats
path: root/debug_toolbar/utils
diff options
context:
space:
mode:
Diffstat (limited to 'debug_toolbar/utils')
-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