Commit 3f8376ea authored by Richard Oudkerk's avatar Richard Oudkerk

Fix handling of SystemExit and exit code. Patch by Brodie Rao.

parent a69712c0
...@@ -267,7 +267,7 @@ class Process(object): ...@@ -267,7 +267,7 @@ class Process(object):
else: else:
sys.stderr.write(str(e.args[0]) + '\n') sys.stderr.write(str(e.args[0]) + '\n')
sys.stderr.flush() sys.stderr.flush()
exitcode = 0 if isinstance(e.args[0], str) else 1 exitcode = 1
except: except:
exitcode = 1 exitcode = 1
import traceback import traceback
......
...@@ -339,7 +339,7 @@ class _TestProcess(BaseTestCase): ...@@ -339,7 +339,7 @@ class _TestProcess(BaseTestCase):
testfn = test_support.TESTFN testfn = test_support.TESTFN
self.addCleanup(test_support.unlink, 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 = self.Process(target=self._test_sys_exit, args=(reason, testfn))
p.daemon = True p.daemon = True
p.start() p.start()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment