Commits

Gary Oberbrunner  committed 0a2ca83 Merge

Merged in techtonik/scons (pull request #66)

Make Debug.caller_stack() return full stack.

  • Participants
  • Parent commits 80dad87, f7ac7fe

Comments (0)

Files changed (1)

File src/engine/SCons/Debug.py

             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