code: def cancelThread(*threads, exception=EscapeException):
      'Raise exception on another thread.'
      for t in threads:
          ctypes.pythonapi.PyThreadState_SetAsyncExc(ctypes.c_long(t.ident), ctypes.py_object(exception)f cancelThread(*threads, exception=EscapeException):
      'Raise exception on another thread.'
      for t in threads:
          ctypes.pythonapi.PyThreadState_SetAsyncExc(ctypes.c_long(t.ident), ctypes.py_object(exception))
docs: Raise exception on another thread.