From e8a83ac75b91fd8bf770caff17b9fe96635abd08 Mon Sep 17 00:00:00 2001 From: David Douard Date: Thu, 20 Nov 2014 19:45:06 +0100 Subject: [deprecation] fix class_renamed() on old-style classes --- deprecation.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'deprecation.py') diff --git a/deprecation.py b/deprecation.py index 9ceff17..1c81b63 100644 --- a/deprecation.py +++ b/deprecation.py @@ -125,11 +125,12 @@ class DeprecationManager(object): return self.class_deprecated(version)(old_name, (new_class,), clsdict) except (NameError, TypeError): # old-style class + warn = self.warn class DeprecatedClass(new_class): """FIXME: There might be a better way to handle old/new-style class """ def __init__(self, *args, **kwargs): - self.warn(version, message, stacklevel=3) + warn(version, message, stacklevel=3) new_class.__init__(self, *args, **kwargs) return DeprecatedClass -- cgit v1.2.1