From c3461c7abe1b1d0de05b88dcfb64d601f4f8a1af 2019-10-30 04:14:52 From: Paul McCarthy Date: 2019-10-30 04:14:52 Subject: [PATCH] RF: Use SetExitOnFrameDelete instead of creating a frame --- diff --git a/IPython/terminal/pt_inputhooks/wx.py b/IPython/terminal/pt_inputhooks/wx.py index d918e67..618f092 100644 --- a/IPython/terminal/pt_inputhooks/wx.py +++ b/IPython/terminal/pt_inputhooks/wx.py @@ -175,13 +175,6 @@ def inputhook_wxphoenix(context): # Wx uses milliseconds poll_interval = 100 - # We have to create a dummy wx.Frame, otherwise wx.App.MainLoop will know - # that it has nothing to do, and will return immediately. - frame = getattr(inputhook_wxphoenix, '_frame', None) - if frame is None: - inputhook_wxphoenix._frame = frame = wx.Frame(None) - frame.Show(False) - # Use a wx.Timer to periodically check whether input is ready - as soon as # it is, we exit the main loop def poll(ev): @@ -198,6 +191,9 @@ def inputhook_wxphoenix(context): if not callable(signal.getsignal(signal.SIGINT)): signal.signal(signal.SIGINT, signal.default_int_handler) + # The SetExitOnFrameDelete call allows us to run the wx mainloop without + # having a frame open. + app.SetExitOnFrameDelete(False) app.MainLoop()