summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2014-02-18 20:44:16 -0500
committerMike Bayer <mike_mp@zzzcomputing.com>2014-02-24 17:35:33 -0500
commita43dc5f688f4c06885ec8066b9fff1c25cb3e305 (patch)
tree9c201c4dc1aa64aa2127818d4d21aec47364d12a
parent99261960b8dcc853e26406e0a2191c9c65ab2fce (diff)
downloadalembic-a43dc5f688f4c06885ec8066b9fff1c25cb3e305.tar.gz
- 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. #175
-rw-r--r--alembic/util.py10
-rw-r--r--docs/build/changelog.rst9
2 files changed, 18 insertions, 1 deletions
diff --git a/alembic/util.py b/alembic/util.py
index 015f732..26f7ac0 100644
--- a/alembic/util.py
+++ b/alembic/util.py
@@ -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
diff --git a/docs/build/changelog.rst b/docs/build/changelog.rst
index 525e169..bf58c6f 100644
--- a/docs/build/changelog.rst
+++ b/docs/build/changelog.rst
@@ -6,6 +6,15 @@ 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