summaryrefslogtreecommitdiff
path: root/coverage/inorout.py
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2021-10-18 21:54:02 -0400
committerNed Batchelder <ned@nedbatchelder.com>2021-10-18 21:54:02 -0400
commitafe6cf34d022e8dbbaa47826c487a98ca6832721 (patch)
tree4cd6ff9621ff6754fae94b398b14597ace432134 /coverage/inorout.py
parent8021196662dcadf161cbeaebb3be4b0392b51803 (diff)
downloadpython-coveragepy-git-afe6cf34d022e8dbbaa47826c487a98ca6832721.tar.gz
fix: avoid measuring generated code. #1160
Diffstat (limited to 'coverage/inorout.py')
-rw-r--r--coverage/inorout.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/coverage/inorout.py b/coverage/inorout.py
index 6bdac06e..3bc7e54e 100644
--- a/coverage/inorout.py
+++ b/coverage/inorout.py
@@ -317,6 +317,9 @@ class InOrOut:
disp.reason = reason
return disp
+ if original_filename.startswith('<'):
+ return nope(disp, "not a real original file name")
+
if frame is not None:
# Compiled Python files have two file names: frame.f_code.co_filename is
# the file name at the time the .pyc was compiled. The second name is