Show More
@@ -292,17 +292,19 b' if HAS_CTYPES:' | |||
|
292 | 292 | """raises the exception, performs cleanup if needed""" |
|
293 | 293 | if not inspect.isclass(exctype): |
|
294 | 294 | raise TypeError("Only types can be raised (not instances)") |
|
295 | res = ctypes.pythonapi.PyThreadState_SetAsyncExc(tid, | |
|
295 | # Explicit cast to c_long is necessary for 64-bit support: | |
|
296 | # See https://bugs.launchpad.net/ipython/+bug/237073 | |
|
297 | res = ctypes.pythonapi.PyThreadState_SetAsyncExc(ctypes.c_long(tid), | |
|
296 | 298 | ctypes.py_object(exctype)) |
|
297 | 299 | if res == 0: |
|
298 | 300 | raise ValueError("invalid thread id") |
|
299 | 301 | elif res != 1: |
|
300 |
# |
|
|
301 |
# and you should call it again with exc=NULL to revert the effect |
|
|
302 | # If it returns a number greater than one, you're in trouble, | |
|
303 | # and you should call it again with exc=NULL to revert the effect | |
|
302 | 304 | ctypes.pythonapi.PyThreadState_SetAsyncExc(tid, 0) |
|
303 | 305 | raise SystemError("PyThreadState_SetAsyncExc failed") |
|
304 | 306 | |
|
305 |
def sigint_handler |
|
|
307 | def sigint_handler(signum,stack_frame): | |
|
306 | 308 | """Sigint handler for threaded apps. |
|
307 | 309 | |
|
308 | 310 | This is a horrible hack to pass information about SIGINT _without_ |
@@ -321,7 +323,7 b' if HAS_CTYPES:' | |||
|
321 | 323 | Term.cout.flush() |
|
322 | 324 | |
|
323 | 325 | else: |
|
324 |
def sigint_handler |
|
|
326 | def sigint_handler(signum,stack_frame): | |
|
325 | 327 | """Sigint handler for threaded apps. |
|
326 | 328 | |
|
327 | 329 | This is a horrible hack to pass information about SIGINT _without_ |
General Comments 0
You need to be logged in to leave comments.
Login now