summaryrefslogtreecommitdiffstats
path: root/Lib/multiprocessing/popen_fork.py
diff options
context:
space:
mode:
authorAntoine Pitrou <pitrou@free.fr>2017-06-12 13:28:19 (GMT)
committerGitHub <noreply@github.com>2017-06-12 13:28:19 (GMT)
commitdfd5f34634f9c505945e9348b4b799544680a7cf (patch)
tree153e7ebd65c9c0777ca8a5e8758d3b54783478c4 /Lib/multiprocessing/popen_fork.py
parentced36a993fcfd1c76637119d31c03156a8772e11 (diff)
downloadcpython-dfd5f34634f9c505945e9348b4b799544680a7cf.zip
cpython-dfd5f34634f9c505945e9348b4b799544680a7cf.tar.gz
cpython-dfd5f34634f9c505945e9348b4b799544680a7cf.tar.bz2
Fix bpo-30589: improve Process.exitcode with forkserver (#1989)
* Fix bpo-30589: improve Process.exitcode with forkserver When the child is killed, Process.exitcode should return -signum, not 255. * Add Misc/NEWS
Diffstat (limited to 'Lib/multiprocessing/popen_fork.py')
-rw-r--r--Lib/multiprocessing/popen_fork.py15
1 files changed, 6 insertions, 9 deletions
diff --git a/Lib/multiprocessing/popen_fork.py b/Lib/multiprocessing/popen_fork.py
index 683b52d..ca28bf3 100644
--- a/Lib/multiprocessing/popen_fork.py
+++ b/Lib/multiprocessing/popen_fork.py
@@ -24,15 +24,12 @@ class Popen(object):
def poll(self, flag=os.WNOHANG):
if self.returncode is None:
- while True:
- try:
- pid, sts = os.waitpid(self.pid, flag)
- except OSError as e:
- # Child process not yet created. See #1731717
- # e.errno == errno.ECHILD == 10
- return None
- else:
- break
+ try:
+ pid, sts = os.waitpid(self.pid, flag)
+ except OSError as e:
+ # Child process not yet created. See #1731717
+ # e.errno == errno.ECHILD == 10
+ return None
if pid == self.pid:
if os.WIFSIGNALED(sts):
self.returncode = -os.WTERMSIG(sts)