##// END OF EJS Templates
Merging bug fix from keyboardint64 branch.
Brian Granger -
r1932:8a6da14b merge
parent child Browse files
Show More
@@ -292,13 +292,15 b' if HAS_CTYPES:'
292 """raises the exception, performs cleanup if needed"""
292 """raises the exception, performs cleanup if needed"""
293 if not inspect.isclass(exctype):
293 if not inspect.isclass(exctype):
294 raise TypeError("Only types can be raised (not instances)")
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 ctypes.py_object(exctype))
298 ctypes.py_object(exctype))
297 if res == 0:
299 if res == 0:
298 raise ValueError("invalid thread id")
300 raise ValueError("invalid thread id")
299 elif res != 1:
301 elif res != 1:
300 # """if it returns a number greater than one, you're in trouble,
302 # If it returns a number greater than one, you're in trouble,
301 # and you should call it again with exc=NULL to revert the effect"""
303 # and you should call it again with exc=NULL to revert the effect
302 ctypes.pythonapi.PyThreadState_SetAsyncExc(tid, 0)
304 ctypes.pythonapi.PyThreadState_SetAsyncExc(tid, 0)
303 raise SystemError("PyThreadState_SetAsyncExc failed")
305 raise SystemError("PyThreadState_SetAsyncExc failed")
304
306
General Comments 0
You need to be logged in to leave comments. Login now