Refs #31672 -- Simplified ExceptionReporter.get_traceback_frames().

This commit is contained in:
Chris Jerdonek 2020-10-15 12:51:50 +02:00 committed by Mariusz Felisiak
parent 9159d173c3
commit a492ccf0bc
1 changed files with 7 additions and 6 deletions

View File

@ -427,12 +427,13 @@ class ExceptionReporter:
# In case there's just one exception, take the traceback from self.tb
exc_value = exceptions.pop()
tb = self.tb if not exceptions else exc_value.__traceback__
frames.extend(self.get_exception_traceback_frames(exc_value, tb))
while exceptions:
exc_value = exceptions.pop()
frames.extend(
self.get_exception_traceback_frames(exc_value, exc_value.__traceback__),
)
while True:
frames.extend(self.get_exception_traceback_frames(exc_value, tb))
try:
exc_value = exceptions.pop()
except IndexError:
break
tb = exc_value.__traceback__
return frames
def get_exception_traceback_frames(self, exc_value, tb):