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) |
|
44 | # connect the callback we care about before we turn it on | |
|
45 | notifier.activated.connect(event_loop.exit) | |
|
46 | notifier.setEnabled(True) | |
|
47 | # only start the event loop we are not already flipped | |
|
48 | if not context.input_is_ready(): | |
|
49 | event_loop.exec_() | |
|
45 | try: | |
|
46 | # connect the callback we care about before we turn it on | |
|
47 | notifier.activated.connect(event_loop.exit) | |
|
48 | notifier.setEnabled(True) | |
|
49 | # only start the event loop we are not already flipped | |
|
50 | if not context.input_is_ready(): | |
|
51 | event_loop.exec_() | |
|
52 | finally: | |
|
53 | notifier.setEnabled(False) |
General Comments 0
You need to be logged in to leave comments.
Login now