summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2015-01-02 09:24:53 -0600
committerBenjamin Peterson <benjamin@python.org>2015-01-02 09:24:53 -0600
commit96246b5a147d1d62f11944b654ea3aa96252001b (patch)
tree5cfe14baf53a1d48dbff9e27c6ed2b1242db9da4
parent20d7a1588e851eb8fc35ba481d7018b841ed9953 (diff)
parent7736215b48c3687e30784b48ee71bf51efe01b17 (diff)
downloadsix-96246b5a147d1d62f11944b654ea3aa96252001b.tar.gz
Merged in timograham/six (pull request #57)
Added unittest aliases.
-rw-r--r--CHANGES3
-rw-r--r--README4
-rw-r--r--documentation/index.rst2
-rw-r--r--six.py2
-rw-r--r--test_six.py12
5 files changed, 19 insertions, 4 deletions
diff --git a/CHANGES b/CHANGES
index cae8ef0..25930bd 100644
--- a/CHANGES
+++ b/CHANGES
@@ -6,6 +6,9 @@ This file lists the changes in each six version.
Development version
-------------------
+- Issue #105 and pull request #58: Ensure `six.wraps` respects the *updated* and
+ *assigned* arguments.
+
- Issue #102: Add `raise_from` to abstract out Python 3's raise from syntax.
- Issue #97: Optimize `six.iterbytes` on Python 2.
diff --git a/README b/README
index 4de73fa..32bab7c 100644
--- a/README
+++ b/README
@@ -9,8 +9,8 @@ notice must be retained.)
Online documentation is at http://pythonhosted.org/six/.
-Bugs can be reported to http://bitbucket.org/gutworth/six. The code can also be
-found there.
+Bugs can be reported to https://bitbucket.org/gutworth/six. The code can also
+be found there.
For questions about six or porting in general, email the python-porting mailing
list: http://mail.python.org/mailman/listinfo/python-porting
diff --git a/documentation/index.rst b/documentation/index.rst
index 6b3ad1e..25e5345 100644
--- a/documentation/index.rst
+++ b/documentation/index.rst
@@ -18,7 +18,7 @@ tracker and code hosting is on `BitBucket <http://bitbucket.org/gutworth/six>`_.
The name, "six", comes from the fact that 2*3 equals 6. Why not addition?
Multiplication is more powerful, and, anyway, "five" has already been snatched
-away by the Zope Five project.
+away by the (admittedly now moribund) Zope Five project.
Indices and tables
diff --git a/six.py b/six.py
index 303fd2d..8cca408 100644
--- a/six.py
+++ b/six.py
@@ -747,7 +747,7 @@ if sys.version_info[0:2] < (3, 4):
def wraps(wrapped, assigned=functools.WRAPPER_ASSIGNMENTS,
updated=functools.WRAPPER_UPDATES):
def wrapper(f):
- f = functools.wraps(wrapped)(f)
+ f = functools.wraps(wrapped, assigned, updated)(f)
f.__wrapped__ = wrapped
return f
return wrapper
diff --git a/test_six.py b/test_six.py
index c023862..2a9ca74 100644
--- a/test_six.py
+++ b/test_six.py
@@ -702,6 +702,18 @@ def test_wraps():
assert k is original_k
assert not hasattr(k, '__wrapped__')
+ def f(g, assign, update):
+ def w():
+ return 42
+ w.glue = {"foo" : "bar"}
+ return six.wraps(g, assign, update)(w)
+ k.glue = {"melon" : "egg"}
+ k.turnip = 43
+ k = f(k, ["turnip"], ["glue"])
+ assert k.__name__ == "w"
+ assert k.turnip == 43
+ assert k.glue == {"melon" : "egg", "foo" : "bar"}
+
def test_add_metaclass():
class Meta(type):