From e0030b76e2f4cdcfbfd3f68f285bbe55e93b6835 Mon Sep 17 00:00:00 2001 From: Paul McCarthy Date: Mon, 8 Jun 2020 17:17:49 +0100 Subject: [PATCH] BF: Make sure to stop timer, otherwise poll function may continue to get called after ExitMainLoop has been called --- IPython/terminal/pt_inputhooks/wx.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/IPython/terminal/pt_inputhooks/wx.py b/IPython/terminal/pt_inputhooks/wx.py index 618f092b4f9..a0f4442c771 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)