diff --git a/IPython/Shell.py b/IPython/Shell.py index 5454f7b..5fdab89 100644 --- a/IPython/Shell.py +++ b/IPython/Shell.py @@ -292,7 +292,9 @@ if HAS_CTYPES: """raises the exception, performs cleanup if needed""" if not inspect.isclass(exctype): raise TypeError("Only types can be raised (not instances)") - res = ctypes.pythonapi.PyThreadState_SetAsyncExc(tid, + # Explicit cast to c_long is necessary for 64-bit support: + # See https://bugs.launchpad.net/ipython/+bug/237073 + res = ctypes.pythonapi.PyThreadState_SetAsyncExc(ctypes.c_long(tid), ctypes.py_object(exctype)) if res == 0: raise ValueError("invalid thread id")