]> granicus.if.org Git - python/commitdiff
Make the trace module ignore modules whose names start with "<" and
authorBrett Cannon <brett@python.org>
Wed, 11 Apr 2012 01:05:53 +0000 (21:05 -0400)
committerBrett Cannon <brett@python.org>
Wed, 11 Apr 2012 01:05:53 +0000 (21:05 -0400)
end with ">", i.e. follow convention.

Lib/trace.py
Misc/NEWS

index 850369b9ff4c4516c6564c2fcaf0a9eb6b52a593..885824aff27836fca0cc1cba35eb3125d343cc46 100644 (file)
@@ -244,8 +244,7 @@ class CoverageResults:
         """Return True if the filename does not refer to a file
         we want to have reported.
         """
-        return (filename == "<string>" or
-                filename.startswith("<doctest "))
+        return filename.startswith('<') and filename.endswith('>')
 
     def update(self, other):
         """Merge in the data from another CoverageResults"""
index 6eb401c4f7a441ef3c11d10d3416a0db7319055e..f7440eea46c954cba42dc6d3170ab470b057e97d 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -19,6 +19,10 @@ Core and Builtins
 Library
 -------
 
+- trace.CoverageResults.is_ignored_filename() now ignores any name that starts
+  with "<" and ends with ">" instead of special-casing "<string>" and
+  "<doctest ".
+
 - Issue #12537: The mailbox module no longer depends on knowledge of internal
   implementation details of the email package Message object.