PyDocs

Nav

Generic Operating System Services

waitstatus_to_exitcode

os

function · Added in 3.9UnixWindowsnot WASInot Androidnot iOS
  • waitstatus_to_exitcode(status)
Convert a wait status to an exit code.

On Unix:

* If WIFEXITED(status) is true, return WEXITSTATUS(status).
* If WIFSIGNALED(status) is true, return -WTERMSIG(status).
* Otherwise, raise a ValueError.

On Windows, return status shifted right by 8 bits.

On Unix, if the process is being traced or if waitpid() was called with
WUNTRACED option, the caller must first check if WIFSTOPPED(status) is
true.  This function must not be called if WIFSTOPPED(status) is true.
0 Examples
No examples for os/waitstatus_to_exitcode.
See Also
No see-alsos for os/waitstatus_to_exitcode
0 Notes
No notes for waitstatus_to_exitcode