Fix handling of SystemExit and exit code. Patch by Brodie Rao.
This commit is contained in:
parent
edcf8daaed
commit
8731d7b3c6
|
@ -266,7 +266,7 @@ class Process(object):
|
|||
exitcode = e.args[0]
|
||||
else:
|
||||
sys.stderr.write(str(e.args[0]) + '\n')
|
||||
exitcode = 0 if isinstance(e.args[0], str) else 1
|
||||
exitcode = 1
|
||||
except:
|
||||
exitcode = 1
|
||||
import traceback
|
||||
|
|
|
@ -467,7 +467,7 @@ class _TestSubclassingProcess(BaseTestCase):
|
|||
testfn = test.support.TESTFN
|
||||
self.addCleanup(test.support.unlink, testfn)
|
||||
|
||||
for reason, code in (([1, 2, 3], 1), ('ignore this', 0)):
|
||||
for reason, code in (([1, 2, 3], 1), ('ignore this', 1)):
|
||||
p = self.Process(target=self._test_sys_exit, args=(reason, testfn))
|
||||
p.daemon = True
|
||||
p.start()
|
||||
|
|
Loading…
Reference in New Issue