]> granicus.if.org Git - python/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 482ea0a37a83bc6862449fa3cf3d47c3c004ad94..44c1e44242f916a29dd1ac161c6f214c31130bfc 100644 (file)
@@ -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
index a8928eeb7ba6acc8f771d5a78a140dbd87a763a9..262ab0660b2ca71160bc9fbc3137c8ca49cba0ea 100644 (file)
@@ -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()