Show More
@@ -1,10 +1,13 | |||||
1 | # Standard library imports. |
|
1 | # Copyright (c) IPython Development Team. | |
|
2 | # Distributed under the terms of the Modified BSD License. | |||
|
3 | ||||
2 | try: |
|
4 | try: | |
3 | import ctypes |
|
5 | import ctypes | |
4 | except: |
|
6 | except: | |
5 | ctypes = None |
|
7 | ctypes = None | |
6 | import os |
|
8 | import os | |
7 | import platform |
|
9 | import platform | |
|
10 | import signal | |||
8 | import time |
|
11 | import time | |
9 | try: |
|
12 | try: | |
10 | from _thread import interrupt_main # Py 3 |
|
13 | from _thread import interrupt_main # Py 3 | |
@@ -129,7 +132,10 class ParentPollerWindows(Thread): | |||||
129 | handle = handles[result - WAIT_OBJECT_0] |
|
132 | handle = handles[result - WAIT_OBJECT_0] | |
130 |
|
133 | |||
131 | if handle == self.interrupt_handle: |
|
134 | if handle == self.interrupt_handle: | |
132 | interrupt_main() |
|
135 | # check if signal handler is callable | |
|
136 | # to avoid 'int not callable' error (Python issue #23395) | |||
|
137 | if callable(signal.getsignal(signal.SIGINT)): | |||
|
138 | interrupt_main() | |||
133 |
|
139 | |||
134 | elif handle == self.parent_handle: |
|
140 | elif handle == self.parent_handle: | |
135 | os._exit(1) |
|
141 | os._exit(1) |
General Comments 0
You need to be logged in to leave comments.
Login now