summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--coverage/control.py6
-rw-r--r--tox.ini14
2 files changed, 18 insertions, 2 deletions
diff --git a/coverage/control.py b/coverage/control.py
index 4c087655..d2110552 100644
--- a/coverage/control.py
+++ b/coverage/control.py
@@ -248,7 +248,11 @@ class Coverage(object):
# PyPy 2.4 has no __file__ in the builtin modules, but the code
# objects still have the filenames. So dig into one to find
# the path to exclude.
- structseq_file = _structseq.structseq_new.func_code.co_filename
+ structseq_new = _structseq.structseq_new
+ try:
+ structseq_file = structseq_new.func_code.co_filename
+ except AttributeError:
+ structseq_file = structseq_new.__code__.co_filename
self.pylib_dirs.add(self._canonical_dir(structseq_file))
# To avoid tracing the coverage code itself, we skip anything located
diff --git a/tox.ini b/tox.ini
index 96f97dcf..3b78ea52 100644
--- a/tox.ini
+++ b/tox.ini
@@ -4,7 +4,7 @@
# and then run "tox" from this directory.
[tox]
-envlist = py26, py27, py32, py33, py34, pypy22, pypy23, pypy24
+envlist = py26, py27, py32, py33, py34, pypy22, pypy23, pypy24, pypy3_23, pypy3_24
[testenv]
commands =
@@ -75,3 +75,15 @@ basepython = pypy2.4
# PyPy has no C extensions
setenv =
COVERAGE_NO_EXTENSION=1
+
+[testenv:pypy3_23]
+basepython = pypy3-2.3
+# PyPy has no C extensions
+setenv =
+ COVERAGE_NO_EXTENSION=1
+
+[testenv:pypy3_24]
+basepython = pypy3-2.4
+# PyPy has no C extensions
+setenv =
+ COVERAGE_NO_EXTENSION=1