# HG changeset patch # User Brodie Rao # Date 1382385780 25200 # Mon Oct 21 13:03:00 2013 -0700 # Branch 2.7 # Node ID 2ab449c488023bb4590b258b5d5ed36bfefdfdd4 # Parent 737b79e524aae18725874706e690fa72ea4937e4 Issue #19338: Properly set exitcode to 1 for non-integer SystemExit arguments This fixes a regression introduced in da5b370f41a1 on the 2.7 branch and 4346cba353b4 on the 3.2 branch. diff --git a/Lib/multiprocessing/process.py b/Lib/multiprocessing/process.py --- 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 --- 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()