Skip to content

Commit dd8985e

Browse files
authored
Backport PR ipython#14828 on branch 8.x (Explicitly create QEventLoop separately from QApplication) (ipython#14829)
Backport PR ipython#14828: Explicitly create QEventLoop separately from QApplication
2 parents 5f2db21 + 8d9d24d commit dd8985e

File tree

1 file changed

+3
-1
lines changed
  • IPython/terminal/pt_inputhooks

1 file changed

+3
-1
lines changed

IPython/terminal/pt_inputhooks/qt.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,14 +50,16 @@ def inputhook(context):
5050
except AttributeError: # Only for Qt>=5.14.
5151
pass
5252
_appref = app = QtGui.QApplication([" "])
53-
_eventloop = QtCore.QEventLoop(app)
5453

5554
# "reclaim" IPython sys.excepthook after event loop starts
5655
# without this, it defaults back to BaseIPythonApplication.excepthook
5756
# and exceptions in the Qt event loop are rendered without traceback
5857
# formatting and look like "bug in IPython".
5958
QtCore.QTimer.singleShot(0, _reclaim_excepthook)
6059

60+
if _eventloop is None:
61+
_eventloop = QtCore.QEventLoop(app)
62+
6163
if sys.platform == 'win32':
6264
# The QSocketNotifier method doesn't appear to work on Windows.
6365
# Use polling instead.

0 commit comments

Comments
 (0)