##// END OF EJS Templates
FIX: make sure the QSocketNotifier is disabled...
Thomas A Caswell -
Show More
@@ -7,6 +7,7 b' from IPython.external.qt_for_kernel import QtCore, QtGui'
7 7 _appref = None
8 8 _already_warned = False
9 9
10
10 11 def inputhook(context):
11 12 global _appref
12 13 app = QtCore.QCoreApplication.instance()
@@ -41,9 +42,12 b' def inputhook(context):'
41 42 # loop when there is input ready to read.
42 43 notifier = QtCore.QSocketNotifier(context.fileno(),
43 44 QtCore.QSocketNotifier.Read)
45 try:
44 46 # connect the callback we care about before we turn it on
45 47 notifier.activated.connect(event_loop.exit)
46 48 notifier.setEnabled(True)
47 49 # only start the event loop we are not already flipped
48 50 if not context.input_is_ready():
49 51 event_loop.exec_()
52 finally:
53 notifier.setEnabled(False)
General Comments 0
You need to be logged in to leave comments. Login now