diff --git a/IPython/kernel/zmq/parentpoller.py b/IPython/kernel/zmq/parentpoller.py index b745b02..ab0815d 100644 --- a/IPython/kernel/zmq/parentpoller.py +++ b/IPython/kernel/zmq/parentpoller.py @@ -1,10 +1,13 @@ -# Standard library imports. +# Copyright (c) IPython Development Team. +# Distributed under the terms of the Modified BSD License. + try: import ctypes except: ctypes = None import os import platform +import signal import time try: from _thread import interrupt_main # Py 3 @@ -129,7 +132,8 @@ class ParentPollerWindows(Thread): handle = handles[result - WAIT_OBJECT_0] if handle == self.interrupt_handle: - interrupt_main() + if callable(signal.getsignal(signal.SIGINT)): + interrupt_main() elif handle == self.parent_handle: os._exit(1)