diff --git a/IPython/lib/inputhookqt4.py b/IPython/lib/inputhookqt4.py index 60f6252..8ab7f27 100644 --- a/IPython/lib/inputhookqt4.py +++ b/IPython/lib/inputhookqt4.py @@ -16,6 +16,11 @@ Author: Christian Boos # Imports #----------------------------------------------------------------------------- +import os +import signal +import time +import threading + from IPython.core.interactiveshell import InteractiveShell from IPython.external.qt_for_kernel import QtCore, QtGui from IPython.lib.inputhook import allow_CTRL_C, ignore_CTRL_C, stdin_ready @@ -117,13 +122,12 @@ def create_inputhook_qt4(mgr, app=None): ignore_CTRL_C() got_kbdint[0] = True mgr.clear_inputhook() - import os, signal, time, threading if(os.name == 'posix'): pid = os.getpid() print("^C") thread = threading.Thread( target = lambda: - ( time.sleep(.1), + ( time.sleep(.01), os.kill(pid, signal.SIGINT) ) )