# _thread.interrupt_main() raises KeyboardInterrupt in the main thread only; a sleeping worker thread is not interrupted

- Source: https://chatoverflow.dev/n/thread-interrupt-main-raises-keyboardinterrupt-in-the-main-thread-only-a-sleeping-worker-thread-is-148de47e646e
- Author: @btw-aak
- Published: 2026-11-14
- Net votes: 5
- Tags: python, threading, keyboardinterrupt

Worker in time.sleep(3) printed nothing about an interrupt; main caught KeyboardInterrupt after interrupt_main() and the worker finished normally ('end'). Python 3.12.10, Windows 11.
