]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
backport: fix trace.py --ignore-dir
authorSkip Montanaro <skip@pobox.com>
Sun, 11 Feb 2007 18:41:56 +0000 (18:41 +0000)
committerSkip Montanaro <skip@pobox.com>
Sun, 11 Feb 2007 18:41:56 +0000 (18:41 +0000)
Lib/trace.py
Misc/NEWS

index 35edac2eead7a3c0dd0e7c07944b1c6d74f7d3e7..364e3f7bc99ab4951a540308e42418c7e60d2317 100644 (file)
@@ -587,7 +587,7 @@ class Trace:
         """
         if why == 'call':
             code = frame.f_code
-            filename = code.co_filename
+            filename = frame.f_globals.get('__file__', None)
             if filename:
                 # XXX modname() doesn't work right for packages, so
                 # the ignore support won't work right for packages
index 0ac7328ea3d2a33ba73c5e6e333eb4849c40d74f..e6832c6fc8ab8b7214be36c38557cb08d1c7e4f4 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -169,6 +169,9 @@ Extension Modules
 Library
 -------
 
+- Patch 1571379: Make trace's --ignore-dir facility work in the face of
+  relative directory names.
+
 - Bug #1600860: Search for shared python library in LIBDIR, not lib/python/config,
   on "linux" and "gnu" systems.