mirror of
https://github.com/python/cpython.git
synced 2025-08-30 13:38:43 +00:00
bpo-35727: Use exit code 0 on sys.exit() in multiprocessing.Process. (GH-11538)
This commit is contained in:
parent
baf29b2216
commit
c2ac4cf040
4 changed files with 22 additions and 11 deletions
|
@ -864,12 +864,21 @@ class _TestSubclassingProcess(BaseTestCase):
|
|||
|
||||
os.unlink(testfn)
|
||||
|
||||
for reason in (True, False, 8):
|
||||
p = self.Process(target=sys.exit, args=(reason,))
|
||||
p.daemon = True
|
||||
p.start()
|
||||
join_process(p)
|
||||
self.assertEqual(p.exitcode, reason)
|
||||
cases = [
|
||||
((True,), 1),
|
||||
((False,), 0),
|
||||
((8,), 8),
|
||||
((None,), 0),
|
||||
((), 0),
|
||||
]
|
||||
|
||||
for args, expected in cases:
|
||||
with self.subTest(args=args):
|
||||
p = self.Process(target=sys.exit, args=args)
|
||||
p.daemon = True
|
||||
p.start()
|
||||
join_process(p)
|
||||
self.assertEqual(p.exitcode, expected)
|
||||
|
||||
#
|
||||
#
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue