From ac09b5e7a02dbc193146b85e47b3de771b140652 2013-02-10 22:06:49 From: Lessandro Mariano Date: 2013-02-10 22:06:49 Subject: [PATCH] Use inputhook_wx2 on osx Fixes #2762 --- diff --git a/IPython/lib/inputhookwx.py b/IPython/lib/inputhookwx.py index eaf87bd..2bacb71 100644 --- a/IPython/lib/inputhookwx.py +++ b/IPython/lib/inputhookwx.py @@ -17,6 +17,7 @@ Authors: Robin Dunn, Brian Granger, Ondrej Certik # Imports #----------------------------------------------------------------------------- +import sys import signal import time from timeit import default_timer as clock @@ -159,5 +160,11 @@ def inputhook_wx3(): pass return 0 -# This is our default implementation -inputhook_wx = inputhook_wx3 +if sys.platform == 'darwin': + # On OSX, evtloop.Pending() always returns True, regardless of there being + # any events pending. As such we can't use implementations 1 or 3 of the + # inputhook as those depend on a pending/dispatch loop. + inputhook_wx = inputhook_wx2 +else: + # This is our default implementation + inputhook_wx = inputhook_wx3