From 6638c632a10af6477a712f1a86af6d9e9ab3a3e3 Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Sat, 8 May 2010 19:19:01 -0400 Subject: Don't trace any files with names starting with less-than. They are all fake, and can't be reported on anyway. Fixes #61. --- coverage/control.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'coverage/control.py') 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 == '': - # 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 "", "", or + # "". 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 -- cgit v1.2.1