diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2010-05-08 19:19:01 -0400 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2010-05-08 19:19:01 -0400 |
commit | 5c2e817e0606ee912fbb4f44550d8b29cf0cd278 (patch) | |
tree | b30e30d16b6b07e4378d4a6ec8b8b64fe7eb4fb0 /coverage/control.py | |
parent | d790754b0905b17f34a77aa8e3b05e52561c15e1 (diff) | |
download | python-coveragepy-5c2e817e0606ee912fbb4f44550d8b29cf0cd278.tar.gz |
Don't trace any files with names starting with less-than. They are all fake, and can't be reported on anyway. Fixes #61.
Diffstat (limited to 'coverage/control.py')
-rw-r--r-- | coverage/control.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/coverage/control.py b/coverage/control.py index a3287ae..e4f5fae 100644 --- a/coverage/control.py +++ b/coverage/control.py @@ -139,9 +139,11 @@ class coverage(object): should not. """ - if filename == '<string>': - # There's no point in ever tracing string executions, we can't do - # anything with the data later anyway. + if filename[0] == '<': + # Lots of non-file execution is represented with artificial + # filenames like "<string>", "<doctest readme.txt[0]>", or + # "<exec_function>". Don't ever trace these executions, since we + # can't do anything with the data later anyway. return False # Compiled Python files have two filenames: frame.f_code.co_filename is |