diff options
Diffstat (limited to 'coverage/fullcoverage/encodings.py')
-rw-r--r-- | coverage/fullcoverage/encodings.py | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/coverage/fullcoverage/encodings.py b/coverage/fullcoverage/encodings.py index b248bdbc..b8841866 100644 --- a/coverage/fullcoverage/encodings.py +++ b/coverage/fullcoverage/encodings.py @@ -35,20 +35,14 @@ class FullCoverageTracer: def fullcoverage_trace(self, *args): frame, event, arg = args - self.traces.append((args, frame.f_lineno)) + if frame.f_lineno is not None: + # https://bugs.python.org/issue46911 + self.traces.append((args, frame.f_lineno)) return self.fullcoverage_trace sys.settrace(FullCoverageTracer().fullcoverage_trace) -# In coverage/files.py is actual_filename(), which uses glob.glob. I don't -# understand why, but that use of glob borks everything if fullcoverage is in -# effect. So here we make an ugly hail-mary pass to switch off glob.glob over -# there. This means when using fullcoverage, Windows path names will not be -# their actual case. - -#sys.fullcoverage = True - -# Finally, remove our own directory from sys.path; remove ourselves from +# Remove our own directory from sys.path; remove ourselves from # sys.modules; and re-import "encodings", which will be the real package # this time. Note that the delete from sys.modules dictionary has to # happen last, since all of the symbols in this module will become None |