From 676eebd9600eb938804b652ce572a30e3ee6626e Mon Sep 17 00:00:00 2001 From: Jannis Leidel Date: Sun, 13 May 2012 12:51:55 +0200 Subject: Added support for class methods. --- debug_toolbar/utils/tracking/__init__.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'debug_toolbar/utils') diff --git a/debug_toolbar/utils/tracking/__init__.py b/debug_toolbar/utils/tracking/__init__.py index 6d4b0e3..766c248 100644 --- a/debug_toolbar/utils/tracking/__init__.py +++ b/debug_toolbar/utils/tracking/__init__.py @@ -51,8 +51,7 @@ def _replace_function(func, wrapped): module = import_module(func.__module__) setattr(module, func.__name__, wrapped) elif getattr(func, 'im_self', None): - # TODO: classmethods - raise NotImplementedError + setattr(func.im_self, func.__name__, classmethod(wrapped)) elif hasattr(func, 'im_class'): # for unbound methods setattr(func.im_class, func.__name__, wrapped) -- cgit v1.2.3