summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2014-08-02 16:25:34 -0700
committerBenjamin Peterson <benjamin@python.org>2014-08-02 16:25:34 -0700
commitf1f648c9a437df8be28b64bec6b3a1633378418b (patch)
tree366d1ebfe939a84c43b4a687935aadeaba3ea5f9
parent1dde0905af3bb226206095e32b43de26c7ade9df (diff)
downloadsix-f1f648c9a437df8be28b64bec6b3a1633378418b.tar.gz
accept assigned and updated parameters for wraps() (fixes #85)
-rw-r--r--CHANGES2
-rw-r--r--documentation/index.rst2
-rw-r--r--six.py3
3 files changed, 5 insertions, 2 deletions
diff --git a/CHANGES b/CHANGES
index 698db3c..b89dca5 100644
--- a/CHANGES
+++ b/CHANGES
@@ -6,6 +6,8 @@ This file lists the changes in each six version.
Development version
-------------------
+- Issue #85: Always accept *updated* and *assigned* arguments for wraps().
+
- Issue #86: In reraise(), instantiate the exception if the second argument is
None.
diff --git a/documentation/index.rst b/documentation/index.rst
index 2de3622..e2bdcc3 100644
--- a/documentation/index.rst
+++ b/documentation/index.rst
@@ -222,7 +222,7 @@ functions and methods is the stdlib :mod:`py3:inspect` module.
aliased to :class:`py3:object`.)
-.. function:: wraps(wrapped)
+.. function:: wraps(wrapped, assigned=functools.WRAPPER_ASSIGNMENTS, updated=functools.WRAPPER_UPDATES)
This is exactly the :func:`py3:functools.wraps` decorator, but it sets the
``__wrapped__`` attribute on what it decorates as :func:`py3:functools.wraps`
diff --git a/six.py b/six.py
index 1cc90b0..7c285b1 100644
--- a/six.py
+++ b/six.py
@@ -692,7 +692,8 @@ if print_ is None:
_add_doc(reraise, """Reraise an exception.""")
if sys.version_info[0:2] < (3, 4):
- def wraps(wrapped):
+ def wraps(wrapped, assigned=functools.WRAPPER_ASSIGNMENTS,
+ updated=functools.WRAPPER_UPDATES):
def wrapper(f):
f = functools.wraps(wrapped)(f)
f.__wrapped__ = wrapped