From: Richard Oudkerk Date: Sun, 17 Nov 2013 17:24:11 +0000 (+0000) Subject: Fix handling of SystemExit and exit code. Patch by Brodie Rao. X-Git-Tag: v3.4.0b1~223^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=8731d7b3c69beb226562c5fc2b382af9249fec5c;p=thirdparty%2FPython%2Fcpython.git Fix handling of SystemExit and exit code. Patch by Brodie Rao. --- diff --git a/Lib/multiprocessing/process.py b/Lib/multiprocessing/process.py index 893507bcd5a4..3d32add71ad3 100644 --- a/Lib/multiprocessing/process.py +++ b/Lib/multiprocessing/process.py @@ -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 diff --git a/Lib/test/test_multiprocessing.py b/Lib/test/test_multiprocessing.py index 86cf5c188f58..77ad0f733edf 100644 --- a/Lib/test/test_multiprocessing.py +++ b/Lib/test/test_multiprocessing.py @@ -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()