This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vstinner
Recipients vstinner
Date 2020-03-28.17:35:28
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1585416928.4.0.501687791386.issue40094@roundup.psfhosted.org>
In-reply-to
Content
Hum, I changed my mind and I think that it's worth it to make the function public. Moreover, I prefer "exitcode", since it is closer to "WEXITSTATUS" name than "returncode". So I renamed the function os.status_to_exitcode().

Advantages of the new new function compared to exiting code:

* the function guarantee that result >= 0 means that the process exited and result < 0 means that the process exited due to a signal (was killed by a signal)
* the function raises a well defined exception (ValueError) if the WIFSTOPPED() is true or if the status is unknown: it prevents to misuse WIFSTOPPED()
History
Date User Action Args
2020-03-28 17:35:28vstinnersetrecipients: + vstinner
2020-03-28 17:35:28vstinnersetmessageid: <1585416928.4.0.501687791386.issue40094@roundup.psfhosted.org>
2020-03-28 17:35:28vstinnerlinkissue40094 messages
2020-03-28 17:35:28vstinnercreate