summaryrefslogtreecommitdiff
path: root/coverage/control.py
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2010-05-08 19:19:01 -0400
committerNed Batchelder <ned@nedbatchelder.com>2010-05-08 19:19:01 -0400
commit6638c632a10af6477a712f1a86af6d9e9ab3a3e3 (patch)
tree86a53c532ebbd8c0e96f73b8ec971d4a09981909 /coverage/control.py
parent2ad723a05059d723d9dda504df9bbcd1e091caa2 (diff)
downloadpython-coveragepy-git-6638c632a10af6477a712f1a86af6d9e9ab3a3e3.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.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/coverage/control.py b/coverage/control.py
index a3287ae6..e4f5fae7 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