summaryrefslogtreecommitdiff
path: root/coverage/control.py
diff options
context:
space:
mode:
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.