From fb1fa59067b82bdcdac5bee5dd567b345cf6d22b Mon Sep 17 00:00:00 2001 From: stevenknight Date: Thu, 14 Jan 2010 18:48:24 +0000 Subject: [PATCH] Massage file names in Python stack traces (which are often reported as absolute paths) to a consistent relative path (bootstrap/...). git-svn-id: http://scons.tigris.org/svn/scons/trunk@4619 fdb21ef1-2011-0410-befe-b5e4ea1792b1 --- bin/sconsoutput.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/bin/sconsoutput.py b/bin/sconsoutput.py index e2237c55..41330599 100644 --- a/bin/sconsoutput.py +++ b/bin/sconsoutput.py @@ -745,6 +745,10 @@ class MySGML(sgmllib.SGMLParser): # Massage addresses in object repr strings to a constant. address_re = re.compile(r' at 0x[0-9a-fA-F]*\>') + # Massage file names in stack traces (sometimes reported as absolute + # paths) to a consistent relative path. + engine_re = re.compile(r' File ".*/src/engine/SCons/') + # Python 2.5 changed the stack trace when the module is read # from standard input from read "... line 7, in ?" to # "... line 7, in ". @@ -769,6 +773,7 @@ class MySGML(sgmllib.SGMLParser): content = string.join(lines, '\n' + p) if content: content = address_re.sub(r' at 0x700000>', content) + content = engine_re.sub(r' File "bootstrap/src/engine/SCons/', content) content = file_re.sub(r'\1 ', content) content = nodelist_re.sub(r"\1 'NodeList' object \2", content) content = string.replace(content, '<', '<') -- 2.26.2