]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Fix handling of SystemExit and exit code. Patch by Brodie Rao.
authorRichard Oudkerk <shibturn@gmail.com>
Sun, 17 Nov 2013 17:24:11 +0000 (17:24 +0000)
committerRichard Oudkerk <shibturn@gmail.com>
Sun, 17 Nov 2013 17:24:11 +0000 (17:24 +0000)
Lib/multiprocessing/process.py
Lib/test/test_multiprocessing.py

index 893507bcd5a4dd5bb6730c41ec1e084110bac5bb..3d32add71ad30a73a697a1b31f9c561c1e8f6458 100644 (file)
@@ -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
index 86cf5c188f581ab179e0faf38b434b28e7568850..77ad0f733edfebc5bc13bf96df96f4431bdb2b88 100644 (file)
@@ -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()