From a17d4a6e151ce8492054289efe519e0a19d85164 Mon Sep 17 00:00:00 2001 From: Luke Campagnola Date: Thu, 1 Feb 2018 11:42:01 -0800 Subject: [PATCH] Fix ConsoleWidget to work with changed stack format in python 3 --- pyqtgraph/console/Console.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/pyqtgraph/console/Console.py b/pyqtgraph/console/Console.py index 9b5b1bf7..634aab4a 100644 --- a/pyqtgraph/console/Console.py +++ b/pyqtgraph/console/Console.py @@ -357,6 +357,11 @@ class ConsoleWidget(QtGui.QWidget): # Build stack up to this point 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) while frame is not None: self.frames.insert(0, frame) @@ -373,6 +378,11 @@ class ConsoleWidget(QtGui.QWidget): # And finish the rest of the stack up to the exception 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) while tb is not None: self.frames.append(tb.tb_frame)