summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--machineout.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/machineout.py b/machineout.py
index 83251b0..69a53c6 100644
--- a/machineout.py
+++ b/machineout.py
@@ -75,7 +75,16 @@ class NoseMachineReadableOutput(Plugin):
75 def addFormatted(self, etype, err): 75 def addFormatted(self, etype, err):
76 exctype, value, tb = err 76 exctype, value, tb = err
77 fulltb = traceback.extract_tb(tb) 77 fulltb = traceback.extract_tb(tb)
78 fname, lineno, funname, msg = fulltb[-1] 78
79 fallback = fulltb[-1]
80 try:
81 while True:
82 fname, lineno, funname, msg = fulltb.pop()
83 if fname.startswith(self.basepath):
84 break
85 except IndexError:
86 fname, lineno, funname, msg = fallback
87
79 # explicit support for doctests is needed 88 # explicit support for doctests is needed
80 if is_doctest_traceback(fname): 89 if is_doctest_traceback(fname):
81 # doctest traceback includes pre-formatted error message 90 # doctest traceback includes pre-formatted error message