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-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3f8376eaa258e6d39f7e2466ca214c26967eaa66;p=python Fix handling of SystemExit and exit code. Patch by Brodie Rao. --- diff --git a/Lib/multiprocessing/process.py b/Lib/multiprocessing/process.py index 482ea0a37a..44c1e44242 100644 --- a/Lib/multiprocessing/process.py +++ b/Lib/multiprocessing/process.py @@ -267,7 +267,7 @@ class Process(object): else: sys.stderr.write(str(e.args[0]) + '\n') sys.stderr.flush() - 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 a8928eeb7b..262ab0660b 100644 --- a/Lib/test/test_multiprocessing.py +++ b/Lib/test/test_multiprocessing.py @@ -339,7 +339,7 @@ class _TestProcess(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()