summaryrefslogtreecommitdiff
path: root/coverage/control.py
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2014-10-26 17:00:30 -0400
committerNed Batchelder <ned@nedbatchelder.com>2014-10-26 17:00:30 -0400
commit155d15f03d425e304570fcf16978108b5aa4b9b5 (patch)
treefa05827a54dfb36013e70583c08c4f7161d17504 /coverage/control.py
parente9e969c5d733647b4bdaabf1f5e384bc79345326 (diff)
downloadpython-coveragepy-155d15f03d425e304570fcf16978108b5aa4b9b5.tar.gz
Test on PyPy3
Diffstat (limited to 'coverage/control.py')
-rw-r--r--coverage/control.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/coverage/control.py b/coverage/control.py
index 4c08765..d211055 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