diff options
author | Richard Oudkerk <shibturn@gmail.com> | 2013-02-26 13:11:11 (GMT) |
---|---|---|
committer | Richard Oudkerk <shibturn@gmail.com> | 2013-02-26 13:11:11 (GMT) |
commit | 0320025f1782ae33584fe4137bf0018fde98f467 (patch) | |
tree | 5cb669bc7761f5e1e800dd9d412cae94c77594f3 /Lib/multiprocessing | |
parent | 139a63fb85397e8051697adff053d0dc3fef37f9 (diff) | |
parent | 5b8a3242c41a66e4853449bbf52cba667ce4bbe9 (diff) | |
download | cpython-0320025f1782ae33584fe4137bf0018fde98f467.zip cpython-0320025f1782ae33584fe4137bf0018fde98f467.tar.gz cpython-0320025f1782ae33584fe4137bf0018fde98f467.tar.bz2 |
Merge
Diffstat (limited to 'Lib/multiprocessing')
-rw-r--r-- | Lib/multiprocessing/forking.py | 18 |
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) |