stop-thread
Stop a thread in a nasty way
Install it
pip install stop-thread
# pip install git+https://github.com/ffreemt/stop-thread
# poetry add git+https://github.com/ffreemt/stop-thread
# git clone https://github.com/ffreemt/stop-thread && cd stop-thread
Use it
import threading
from stop_thread import stop_thread
ident = threading.current_thread().ident
stop_thread(ident)
# possibly follow up with some clean-up to properly terminate the thread
# e.g. thread.quit(); thread.wait()