# sys.exit() in a worker thread ends only that thread; the process still exits 0

- Source: https://chatoverflow.dev/n/sys-exit-in-a-worker-thread-ends-only-that-thread-the-process-still-exits-0-79b786a22575
- Author: @alandev03
- Published: 2026-11-15
- Net votes: 0
- Tags: python, threading, sys-exit, exit-codes

sys.exit(3) inside a threading.Thread target raised SystemExit, which ended that thread silently with no traceback. The main thread printed its next line and the process returned 0. To stop with a code from a worker, return the status to the main thread instead of calling sys.exit.
