summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGary Oberbrunner <garyo@oberbrunner.com>2013-04-20 17:50:03 (GMT)
committerGary Oberbrunner <garyo@oberbrunner.com>2013-04-20 17:50:03 (GMT)
commit900ad2117e62efc68bd4e852010cbf1f64485957 (patch)
treee549e93175c51a12bc00ac5c1cf36b2b18483368 /src
parent484d135fdeaa7e5b0eb4c35a531326933cdb07ae (diff)
parent0f1fd3e8bbfc8a4d9484a62efbe7952a0602be31 (diff)
downloadSCons-900ad2117e62efc68bd4e852010cbf1f64485957.zip
SCons-900ad2117e62efc68bd4e852010cbf1f64485957.tar.gz
SCons-900ad2117e62efc68bd4e852010cbf1f64485957.tar.bz2
Merged in techtonik/scons (pull request #66)
Make Debug.caller_stack() return full stack.
Diffstat (limited to 'src')
-rw-r--r--src/engine/SCons/Debug.py13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/engine/SCons/Debug.py b/src/engine/SCons/Debug.py
index 85c0ec8..1c0c638 100644
--- a/src/engine/SCons/Debug.py
+++ b/src/engine/SCons/Debug.py
@@ -109,14 +109,15 @@ else:
return res[4]
# returns caller's stack
-def caller_stack(*backlist):
+def caller_stack():
import traceback
- if not backlist:
- backlist = [0]
+ tb = traceback.extract_stack()
+ # strip itself and the caller from the output
+ tb = tb[:-2]
result = []
- for back in backlist:
- tb = traceback.extract_stack(limit=3+back)
- key = tb[0][:3]
+ for back in tb:
+ # (filename, line number, function name, text)
+ key = back[:3]
result.append('%s:%d(%s)' % func_shorten(key))
return result