summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/sqlalchemy/util.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/sqlalchemy/util.py b/lib/sqlalchemy/util.py
index 28e5083e9..6cb65e395 100644
--- a/lib/sqlalchemy/util.py
+++ b/lib/sqlalchemy/util.py
@@ -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