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
.. 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