summaryrefslogtreecommitdiffstats
path: root/Lib/multiprocessing
diff options
context:
space:
mode:
authorFlorent Xicluna <florent.xicluna@gmail.com>2010-03-07 23:49:03 (GMT)
committerFlorent Xicluna <florent.xicluna@gmail.com>2010-03-07 23:49:03 (GMT)
commit16cd888dd9fa4dc2da642a8edb45e708e296a086 (patch)
tree4a32a08f7f07d4ad3f2cf0112bc899dfd1f82653 /Lib/multiprocessing
parent08611b5e559188c20cfca70de0fa5975857994b0 (diff)
downloadcpython-16cd888dd9fa4dc2da642a8edb45e708e296a086.zip
cpython-16cd888dd9fa4dc2da642a8edb45e708e296a086.tar.gz
cpython-16cd888dd9fa4dc2da642a8edb45e708e296a086.tar.bz2
Backport the Popen.poll() protection from subprocess to multiprocessing. See #1731717.
It should fix transient failures on test_multiprocessing.
Diffstat (limited to 'Lib/multiprocessing')
-rw-r--r--Lib/multiprocessing/forking.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/Lib/multiprocessing/forking.py b/Lib/multiprocessing/forking.py
index 7eda991..a66f7a0 100644
--- a/Lib/multiprocessing/forking.py
+++ b/Lib/multiprocessing/forking.py
@@ -103,7 +103,12 @@ if sys.platform != 'win32':
def poll(self, flag=os.WNOHANG):
if self.returncode is None:
- pid, sts = os.waitpid(self.pid, flag)
+ 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
if pid == self.pid:
if os.WIFSIGNALED(sts):
self.returncode = -os.WTERMSIG(sts)