2

Is it possible to get notification of exceptions that accure during IPythons internal GUI-Event-Loop? Here is an example where an exception is raised but not displayed to the user.

minimal.py:

from PyQt4 import QtCore, QtGui
class TestDialog(QtGui.QDialog):
    def __init__(self):
        QtGui.QDialog.__init__(self)

        self.timer = QtCore.QTimer()
        self.timer.timeout.connect(self.timeout)
        self.timer.start(1000)
        self.show()
    def timeout(self):
        print "before exception"
        raise Exception("Do you see me?")
        print "after exception"

w = TestDialog()

On IPython console type:

%gui qt
runfile('minimal.py')

Output is:

before exception
before exception
.
.
.

My system configuration:

win-64
Python 2.7
IPython 2.1.0
  • I do see the error when using IPython master, so this may be something we have already fixed. – Thomas K Oct 17 '14 at 22:57
  • Here a few more information about my QT-System: ('Qt version:', '4.8.6') ('SIP version:', '4.15.5') ('PyQt version:', '4.10.4') --- I'm using Anaconda and this is the newest available package even though version 4.11.2 has been released already. – Torsten2001 Oct 18 '14 at 18:42
  • I am sorry, but 2 years after the post, the exception is till poping-out in the background console... see my related question:http://stackoverflow.com/questions/40608610/exceptions-in-pyqt-event-loop-and-ipython – Samuel Nov 16 '16 at 13:27

0 Answers0