Message365223
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() |
|
Date |
User |
Action |
Args |
2020-03-28 17:35:28 | vstinner | set | recipients:
+ vstinner |
2020-03-28 17:35:28 | vstinner | set | messageid: <1585416928.4.0.501687791386.issue40094@roundup.psfhosted.org> |
2020-03-28 17:35:28 | vstinner | link | issue40094 messages |
2020-03-28 17:35:28 | vstinner | create | |
|