Merge pull request #627 from campagnola/console-stack-py3
Fix ConsoleWidget to work with changed stack format in python 3.5
This commit is contained in:
commit
4ed09ebdf1
@ -357,6 +357,11 @@ class ConsoleWidget(QtGui.QWidget):
|
|||||||
|
|
||||||
# Build stack up to this point
|
# Build stack up to this point
|
||||||
for index, line in enumerate(traceback.extract_stack(frame)):
|
for index, line in enumerate(traceback.extract_stack(frame)):
|
||||||
|
# extract_stack return value changed in python 3.5
|
||||||
|
if 'FrameSummary' in str(type(line)):
|
||||||
|
print(dir(line))
|
||||||
|
line = (line.filename, line.lineno, line.name, line._line)
|
||||||
|
|
||||||
self.ui.exceptionStackList.addItem('File "%s", line %s, in %s()\n %s' % line)
|
self.ui.exceptionStackList.addItem('File "%s", line %s, in %s()\n %s' % line)
|
||||||
while frame is not None:
|
while frame is not None:
|
||||||
self.frames.insert(0, frame)
|
self.frames.insert(0, frame)
|
||||||
@ -373,6 +378,11 @@ class ConsoleWidget(QtGui.QWidget):
|
|||||||
|
|
||||||
# And finish the rest of the stack up to the exception
|
# And finish the rest of the stack up to the exception
|
||||||
for index, line in enumerate(traceback.extract_tb(tb)):
|
for index, line in enumerate(traceback.extract_tb(tb)):
|
||||||
|
# extract_stack return value changed in python 3.5
|
||||||
|
if 'FrameSummary' in str(type(line)):
|
||||||
|
print(dir(line))
|
||||||
|
line = (line.filename, line.lineno, line.name, line._line)
|
||||||
|
|
||||||
self.ui.exceptionStackList.addItem('File "%s", line %s, in %s()\n %s' % line)
|
self.ui.exceptionStackList.addItem('File "%s", line %s, in %s()\n %s' % line)
|
||||||
while tb is not None:
|
while tb is not None:
|
||||||
self.frames.append(tb.tb_frame)
|
self.frames.append(tb.tb_frame)
|
||||||
|
Loading…
Reference in New Issue
Block a user