diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2014-10-11 22:10:22 -0400 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2014-10-11 22:10:22 -0400 |
commit | a42ed2905db033b68d2f24a35dd4b360bf4376c2 (patch) | |
tree | bfa000b54a9f6a751156a5cd59475844c639e771 /coverage/control.py | |
parent | c84ee62303ba0a4feb12d36db5e1bb2f0938a9c6 (diff) | |
download | python-coveragepy-a42ed2905db033b68d2f24a35dd4b360bf4376c2.tar.gz |
Fix a problem with PyPy 2.4
Diffstat (limited to 'coverage/control.py')
-rw-r--r-- | coverage/control.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/coverage/control.py b/coverage/control.py index 43e440b..e351b00 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. |