Show More
@@ -225,6 +225,7 b' def can_exit():' | |||||
225 |
|
225 | |||
226 |
|
226 | |||
227 | interruptible_debugger = """\ |
|
227 | interruptible_debugger = """\ | |
|
228 | import sys | |||
228 | import threading |
|
229 | import threading | |
229 | import time |
|
230 | import time | |
230 | from os import _exit |
|
231 | from os import _exit | |
@@ -233,9 +234,14 b' from bdb import BdbQuit' | |||||
233 | from IPython.core.debugger import set_trace |
|
234 | from IPython.core.debugger import set_trace | |
234 |
|
235 | |||
235 | def interrupt(): |
|
236 | def interrupt(): | |
|
237 | # Try to emulate the way interruption works in ipykernel | |||
236 | time.sleep(0.1) |
|
238 | time.sleep(0.1) | |
237 | import os, signal |
|
239 | if sys.platform == "win32": | |
238 | os.kill(os.getpid(), signal.SIGINT) |
|
240 | from _thread import interrupt_main | |
|
241 | interrupt_main() | |||
|
242 | else: | |||
|
243 | import os, signal | |||
|
244 | os.kill(os.getpid(), signal.SIGINT) | |||
239 | threading.Thread(target=interrupt).start() |
|
245 | threading.Thread(target=interrupt).start() | |
240 |
|
246 | |||
241 | # Timeout if the interrupt doesn't happen: |
|
247 | # Timeout if the interrupt doesn't happen: |
General Comments 0
You need to be logged in to leave comments.
Login now