Sys.exit in secondary threads

Pakal chambon.pascal at
Fri Oct 8 21:13:28 CEST 2010

I've noticed that there is nothing in python's documentation regarding
the use of sys.exit(code) in a non-main thread.

As far as I've seen, the behaviour in this case is to simply exit the
thread, without caring about the return code. in the main thread
however, the return code becomes the official return code of the whole

Is that all we have to say about sys.exit() in a multithreaded
program ? Or are there corner cases I've missed ? We'd better document
this anyway.


More information about the Python-list mailing list