def _async_raise(tid, exctype):
 if (not inspect.isclass(exctype)):
  raise TypeError('Only types can be raised (not instances)')
 res = ctypes.pythonapi.PyThreadState_SetAsyncExc(ctypes.c_long(tid), ctypes.py_object(exctype))
 if (res == 0):
  raise ValueError('invalid thread id')
 elif (res != 1):
  ctypes.pythonapi.PyThreadState_SetAsyncExc(ctypes.c_long(tid), None)
  raise SystemError('PyThreadState_SetAsyncExc failed')

def _async_raise ( tid , exctype ) : if ( not inspect . isclass ( exctype ) ) : raise TypeError ( 'Only types can be raised (not instances)' ) res = ctypes . pythonapi . PyThreadState_SetAsyncExc ( ctypes . c_long ( tid ) , ctypes . py_object ( exctype ) ) if ( res == 0 ) : raise ValueError ( 'invalid thread id' ) elif ( res != 1 ) : ctypes . pythonapi . PyThreadState_SetAsyncExc ( ctypes . c_long ( tid ) , None ) raise SystemError ( 'PyThreadState_SetAsyncExc failed' )
raises the exception .