From 4e2b27ffffb1f713e3321d2c74f2f0b2b4f7c142 Mon Sep 17 00:00:00 2001 From: Colin Watson Date: Tue, 4 Mar 2014 11:08:48 +0000 Subject: [PATCH 1/2] Adjust tests to support Python 3.4. The fix for http://bugs.python.org/issue13831 broke our tests. Monkey-patch it out so that we can still see the original problem. --- README.rst | 16 ++++++++++------ tox.ini | 5 +++++ 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/README.rst b/README.rst index bbf597d..cca2dd5 100644 --- a/README.rst +++ b/README.rst @@ -233,7 +233,11 @@ How's this useful ? Imagine you're using multiprocessing like this:: >>> import traceback >>> from multiprocessing import Pool + >>> import multiprocessing.pool >>> from examples import func_a + >>> # Undo the fix for http://bugs.python.org/issue13831 so that we can + >>> # see the effects of our change. + >>> multiprocessing.pool.ExceptionWithTraceback = lambda e, t: e >>> pool = Pool() >>> try: ... for i in pool.map(func_a, range(5)): @@ -242,7 +246,7 @@ How's this useful ? Imagine you're using multiprocessing like this:: ... print(traceback.format_exc()) ... Traceback (most recent call last): - File "", line 2, in + File "", line 2, in for i in pool.map(func_a, range(5)): File "...multiprocessing...pool.py", line ..., in map ... @@ -267,7 +271,7 @@ Not very useful is it? Let's sort this out:: ... print(traceback.format_exc()) ... Traceback (most recent call last): - File "", line 4, in + File "", line 4, in i.reraise() File "...tblib...decorators.py", line ..., in reraise reraise(self.exc_type, self.exc_value, self.traceback) @@ -313,13 +317,13 @@ What if we have a local call stack ? ... except: ... print(traceback.format_exc()) Traceback (most recent call last): - File "", line 2, in + File "", line 2, in local_2() - File "", line 2, in local_2 + File "", line 2, in local_2 local_1() - File "", line 2, in local_1 + File "", line 2, in local_1 local_0() - File "", line 5, in local_0 + File "", line 5, in local_0 i.reraise() File "...tblib...decorators.py", line 19, in reraise reraise(self.exc_type, self.exc_value, self.traceback) diff --git a/tox.ini b/tox.ini index f1de1e1..cfa2b83 100644 --- a/tox.ini +++ b/tox.ini @@ -4,6 +4,7 @@ envlist = py2.7, py3.2, py3.3, + py3.4, pypy [testenv] @@ -34,6 +35,10 @@ deps = {[base]deps} [testenv:py3.3] basepython = python3.3 +deps = + {[base]deps} +[testenv:py3.4] +basepython = python3.4 deps = {[base]deps} [testenv:pypy] From 3d23ab352026b6054781127d8e50cc8f39b77cff Mon Sep 17 00:00:00 2001 From: Colin Watson Date: Tue, 4 Mar 2014 11:15:49 +0000 Subject: [PATCH 2/2] Mention 3.4 support in README.rst. --- README.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.rst b/README.rst index cca2dd5..6393ab8 100644 --- a/README.rst +++ b/README.rst @@ -21,7 +21,7 @@ Requirements ============ :OS: Any -:Runtime: Python 2.6, 2.7, 3.2, 3.3 and PyPy. +:Runtime: Python 2.6, 2.7, 3.2, 3.3, 3.4 and PyPy. Pickling tracebacks ===================