summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2014-10-28 09:24:33 -0400
committerNed Batchelder <ned@nedbatchelder.com>2014-10-28 09:24:33 -0400
commitff22f3bda01cde32b8dab56997afd02445c1c583 (patch)
treedebdae87c04c35c3966b75b12fbc0b7ab7a8f8c8
parenta0f2211ea7f0766516ba2a3f3f99c1a3fd1c0e9d (diff)
downloadpython-coveragepy-git-ff22f3bda01cde32b8dab56997afd02445c1c583.tar.gz
Fix a weird PyPy3 problem with a weird PyPy3 fix.
-rw-r--r--CHANGES.txt2
-rw-r--r--coverage/execfile.py7
-rw-r--r--doc/index.rst3
3 files changed, 10 insertions, 2 deletions
diff --git a/CHANGES.txt b/CHANGES.txt
index 3338be11..9df12fe2 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -6,7 +6,7 @@ Change history for Coverage.py
Latest
------
-- Officially support PyPy 2.3 and 2.4.
+- Officially support PyPy 2.3 and 2.4, and PyPy3 2.3 and 2.4.
- The original command line switches (`-x` to run a program, etc) are no
longer supported.
diff --git a/coverage/execfile.py b/coverage/execfile.py
index b7877b6a..82cc2217 100644
--- a/coverage/execfile.py
+++ b/coverage/execfile.py
@@ -138,6 +138,13 @@ def run_python_file(filename, args, package=None):
# so that the coverage.py code doesn't appear in the final printed
# traceback.
typ, err, tb = sys.exc_info()
+
+ # PyPy3 weirdness. If I don't access __context__, then somehow it
+ # is non-None when the exception is reported at the upper layer,
+ # and a nested exception is shown to the user. This getattr fixes
+ # it somehow? https://bitbucket.org/pypy/pypy/issue/1903
+ getattr(err, '__context__', None)
+
raise ExceptionDuringRun(typ, err, tb.tb_next)
finally:
# Restore the old __main__
diff --git a/doc/index.rst b/doc/index.rst
index d557665c..ba83f2cd 100644
--- a/doc/index.rst
+++ b/doc/index.rst
@@ -50,7 +50,8 @@ not.
.. ifconfig:: prerelease
The latest version is coverage.py 4.0a1, released 27 September 2014.
- It is supported on Python versions 2.6 through 3.4, and PyPy 2.2 through 2.4.
+ It is supported on Python versions 2.6 through 3.4, PyPy 2.2 through 2.4,
+ and PyPy3 2.3 and 2.4.
**This is a pre-release build. The usual warnings about possible bugs apply.**
The latest stable version is coverage.py 3.7.1, `described here`_.