mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
bpo-40094: Add os.waitstatus_to_exitcode() (GH-19201)
Add os.waitstatus_to_exitcode() function to convert a wait status to an exitcode. Suggest waitstatus_to_exitcode() usage in the documentation when appropriate. Use waitstatus_to_exitcode() in: * multiprocessing, os, subprocess and _bootsubprocess modules; * test.support.wait_process(); * setup.py: run_command(); * and many tests.
This commit is contained in:
parent
5dd836030e
commit
65a796e527
18 changed files with 258 additions and 61 deletions
|
@ -29,8 +29,7 @@ class Wait4Test(ForkWait):
|
|||
break
|
||||
time.sleep(0.1)
|
||||
self.assertEqual(spid, cpid)
|
||||
self.assertEqual(status, exitcode << 8,
|
||||
"cause = %d, exit = %d" % (status&0xff, status>>8))
|
||||
self.assertEqual(os.waitstatus_to_exitcode(status), exitcode)
|
||||
self.assertTrue(rusage)
|
||||
|
||||
def tearDownModule():
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue