diff --git a/pyqtgraph/Qt.py b/pyqtgraph/Qt.py index 2ed9d6f9..ad04cd76 100644 --- a/pyqtgraph/Qt.py +++ b/pyqtgraph/Qt.py @@ -151,6 +151,17 @@ elif QT_LIB == PYQT5: # We're using PyQt5 which has a different structure so we're going to use a shim to # recreate the Qt4 structure for Qt5 from PyQt5 import QtGui, QtCore, QtWidgets, uic + + # PyQt5, starting in v5.5, calls qAbort when an exception is raised inside + # a slot. To maintain backward compatibility (and sanity for interactive + # users), we install a global exception hook to override this behavior. + ver = QtCore.PYQT_VERSION_STR.split('.') + if int(ver[1]) >= 5: + sys_excepthook = sys.excepthook + def pyqt5_qabort_override(*args, **kwds): + return sys_excepthook(*args, **kwds) + sys.excepthook = pyqt5_qabort_override + try: from PyQt5 import QtSvg except ImportError: