From e0030b76e2f4cdcfbfd3f68f285bbe55e93b6835 2020-06-08 16:17:49 From: Paul McCarthy Date: 2020-06-08 16:17:49 Subject: [PATCH] BF: Make sure to stop timer, otherwise poll function may continue to get called after ExitMainLoop has been called --- 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)