diff options
author | Richard Oudkerk <shibturn@gmail.com> | 2013-02-26 13:00:15 (GMT) |
---|---|---|
committer | Richard Oudkerk <shibturn@gmail.com> | 2013-02-26 13:00:15 (GMT) |
commit | 5b8a3242c41a66e4853449bbf52cba667ce4bbe9 (patch) | |
tree | 73ce8643ec73d2432aa572fc3511248abd169846 /Lib/multiprocessing | |
parent | 514f056a89a624e4d11dfa5a0e1c0fdb4d820a79 (diff) | |
parent | 7aaa1ef8580660eb6ba94a48ffaf76acbc75a8a6 (diff) | |
download | cpython-5b8a3242c41a66e4853449bbf52cba667ce4bbe9.zip cpython-5b8a3242c41a66e4853449bbf52cba667ce4bbe9.tar.gz cpython-5b8a3242c41a66e4853449bbf52cba667ce4bbe9.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 c5501a2..0bb21c4 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 os.error: - # 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 os.error 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) |