From d19c62f81990247df2f188d5c60bb068e8829756 2020-06-09 00:35:08 From: Matthias Bussonnier Date: 2020-06-09 00:35:08 Subject: [PATCH] Merge pull request #12376 from meeseeksmachine/auto-backport-of-pr-12375-on-7.x --- diff --git a/IPython/terminal/pt_inputhooks/wx.py b/IPython/terminal/pt_inputhooks/wx.py index 618f092..a0f4442 100644 --- a/IPython/terminal/pt_inputhooks/wx.py +++ b/IPython/terminal/pt_inputhooks/wx.py @@ -177,11 +177,13 @@ def inputhook_wxphoenix(context): # Use a wx.Timer to periodically check whether input is ready - as soon as # it is, we exit the main loop + timer = wx.Timer() + def poll(ev): if context.input_is_ready(): + timer.Stop() app.ExitMainLoop() - timer = wx.Timer() timer.Start(poll_interval) timer.Bind(wx.EVT_TIMER, poll)