]> git.ipfire.org Git - thirdparty/sqlalchemy/alembic.git/commitdiff
- Fixed a failure of the system that allows "legacy keyword arguments"
authorMike Bayer <mike_mp@zzzcomputing.com>
Wed, 19 Feb 2014 01:44:16 +0000 (20:44 -0500)
committerMike Bayer <mike_mp@zzzcomputing.com>
Mon, 24 Feb 2014 22:35:33 +0000 (17:35 -0500)
to be understood, which arose as of a change in Python 3.4 regarding
decorators.  A workaround is applied that allows the code to work
across Python 3 versions. #175

alembic/util.py
docs/build/changelog.rst

index 015f732eeb5f8cff0f4254424f8e4f7731e24383..26f7ac09bfdc174791e3782f67ef2e8c9218f450 100644 (file)
@@ -325,7 +325,15 @@ def _with_legacy_names(translations):
                 metadata)
         decorated = eval(code, {"target": go})
         decorated.__defaults__ = getattr(fn, '__func__', fn).__defaults__
-        return update_wrapper(decorated, fn)
+        update_wrapper(decorated, fn)
+        if hasattr(decorated, '__wrapped__'):
+            # update_wrapper in py3k applies __wrapped__, which causes
+            # inspect.getargspec() to ignore the extra arguments on our
+            # wrapper as of Python 3.4.  We need this for the
+            # "module class proxy" thing though, so just del the __wrapped__
+            # for now. See #175 as well as bugs.python.org/issue17482
+            del decorated.__wrapped__
+        return decorated
 
     return decorate
 
index 525e169bea4f3eb1b012ff5e27bea92107bdb95f..bf58c6fa5954fc789a3f3db63c2681aecf984e79 100644 (file)
@@ -5,6 +5,15 @@ Changelog
 .. changelog::
     :version: 0.6.4
 
+    .. change::
+      :tags: bug, py3k
+      :tickets: 175
+
+      Fixed a failure of the system that allows "legacy keyword arguments"
+      to be understood, which arose as of a change in Python 3.4 regarding
+      decorators.  A workaround is applied that allows the code to work
+      across Python 3 versions.
+
     .. change::
       :tags: feature
       :pullreq: bitbucket:20