]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
Don't set __name__ on py 2.3
authorJason Kirtland <jek@discorporate.us>
Wed, 1 Aug 2007 19:27:58 +0000 (19:27 +0000)
committerJason Kirtland <jek@discorporate.us>
Wed, 1 Aug 2007 19:27:58 +0000 (19:27 +0000)
lib/sqlalchemy/util.py

index 28e5083e95186500aec54675cd9b9d79154ee3c6..6cb65e3953c64e6afcb1b5f5642fd0a9e0ae302b 100644 (file)
@@ -549,7 +549,11 @@ def deprecated(func, add_deprecation_to_docstring=True):
         warnings.warn(logging.SADeprecationWarning("Call to deprecated function %s" % func.__name__),
                       stacklevel=2)
         return func(*args, **kwargs)
-    func_with_warning.__name__ = func.__name__
     func_with_warning.__doc__ = (add_deprecation_to_docstring and 'Deprecated.\n' or '') + func.__doc__
     func_with_warning.__dict__.update(func.__dict__)
+    try:
+        func_with_warning.__name__ = func.__name__
+    except TypeError:
+        pass
+
     return func_with_warning