From b489fe6f84d6705fe46b123d36ab50a04f70a9bd Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Sun, 18 Nov 2018 21:58:36 -0500 Subject: Don't try to use PyPy 'filenames' like '/lib_pypy/_structseq.py' --- coverage/inorout.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'coverage/inorout.py') diff --git a/coverage/inorout.py b/coverage/inorout.py index 15e496af..3e0613a3 100644 --- a/coverage/inorout.py +++ b/coverage/inorout.py @@ -155,13 +155,15 @@ class InOrOut(object): if _structseq and not hasattr(_structseq, '__file__'): # PyPy 2.4 has no __file__ in the builtin modules, but the code # objects still have the file names. So dig into one to find - # the path to exclude. + # the path to exclude. The "filename" might be synthetic, + # don't be fooled by those. 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_paths.add(canonical_path(structseq_file)) + if not structseq_file.startswith("<"): + self.pylib_paths.add(canonical_path(structseq_file)) # To avoid tracing the coverage.py code itself, we skip anything # located where we are. -- cgit v1.2.1