summaryrefslogtreecommitdiffstats
path: root/Lib/multiprocessing
diff options
context:
space:
mode:
authorRichard Oudkerk <shibturn@gmail.com>2013-02-26 13:11:11 (GMT)
committerRichard Oudkerk <shibturn@gmail.com>2013-02-26 13:11:11 (GMT)
commit0320025f1782ae33584fe4137bf0018fde98f467 (patch)
tree5cb669bc7761f5e1e800dd9d412cae94c77594f3 /Lib/multiprocessing
parent139a63fb85397e8051697adff053d0dc3fef37f9 (diff)
parent5b8a3242c41a66e4853449bbf52cba667ce4bbe9 (diff)
downloadcpython-0320025f1782ae33584fe4137bf0018fde98f467.zip
cpython-0320025f1782ae33584fe4137bf0018fde98f467.tar.gz
cpython-0320025f1782ae33584fe4137bf0018fde98f467.tar.bz2
Merge
Diffstat (limited to 'Lib/multiprocessing')
-rw-r--r--Lib/multiprocessing/forking.py18
1 files changed, 12 insertions, 6 deletions
diff --git a/Lib/multiprocessing/forking.py b/Lib/multiprocessing/forking.py
index d3e7a10..7bda412 100644
--- a/Lib/multiprocessing/forking.py
+++ b/Lib/multiprocessing/forking.py
@@ -10,6 +10,7 @@
import os
import sys
import signal
+import errno
from multiprocessing import util, process
@@ -109,12 +110,17 @@ if sys.platform != 'win32':
def poll(self, flag=os.WNOHANG):
if self.returncode is None:
- try:
- pid, sts = os.waitpid(self.pid, flag)
- except OSError:
- # Child process not yet created. See #1731717
- # e.errno == errno.ECHILD == 10
- return None
+ while True:
+ try:
+ pid, sts = os.waitpid(self.pid, flag)
+ except OSError as e:
+ if e.errno == errno.EINTR:
+ continue
+ # Child process not yet created. See #1731717
+ # e.errno == errno.ECHILD == 10
+ return None
+ else:
+ break
if pid == self.pid:
if os.WIFSIGNALED(sts):
self.returncode = -os.WTERMSIG(sts)