diff options
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 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 |