summaryrefslogtreecommitdiff
path: root/coverage/control.py
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2014-10-11 22:10:22 -0400
committerNed Batchelder <ned@nedbatchelder.com>2014-10-11 22:10:22 -0400
commit845c03dfad682c931dd55cfcff81d5612a803df6 (patch)
tree06f4b71b80955ea839c8b20ea90b6dcae1e290d4 /coverage/control.py
parent355782efef23af319547bfa8346e205e7628f13d (diff)
downloadpython-coveragepy-git-845c03dfad682c931dd55cfcff81d5612a803df6.tar.gz
Fix a problem with PyPy 2.4
Diffstat (limited to 'coverage/control.py')
-rw-r--r--coverage/control.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/coverage/control.py b/coverage/control.py
index 43e440b8..e351b005 100644
--- a/coverage/control.py
+++ b/coverage/control.py
@@ -244,6 +244,12 @@ class Coverage(object):
for m in (atexit, os, platform, random, socket, _structseq):
if m is not None and hasattr(m, "__file__"):
self.pylib_dirs.add(self._canonical_dir(m))
+ if _structseq and not hasattr(_structseq, '__file__'):
+ # 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
+ self.pylib_dirs.add(self._canonical_dir(structseq_file))
# To avoid tracing the coverage code itself, we skip anything located
# where we are.