summaryrefslogtreecommitdiffstats
path: root/Lib/multiprocessing/forking.py
diff options
context:
space:
mode:
authorFlorent Xicluna <florent.xicluna@gmail.com>2010-03-08 13:32:17 (GMT)
committerFlorent Xicluna <florent.xicluna@gmail.com>2010-03-08 13:32:17 (GMT)
commit998171f0d72b270bd578ee9d6fc4937f0cc9776b (patch)
treedbf03a7763d151b302aa94dd5bf3b3722fe864f8 /Lib/multiprocessing/forking.py
parent4886d246a89895a25c4733d537fdcfdede5e50f9 (diff)
downloadcpython-998171f0d72b270bd578ee9d6fc4937f0cc9776b.zip
cpython-998171f0d72b270bd578ee9d6fc4937f0cc9776b.tar.gz
cpython-998171f0d72b270bd578ee9d6fc4937f0cc9776b.tar.bz2
Merged revisions 78777,78787,78790 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r78777 | florent.xicluna | 2010-03-08 00:49:03 +0100 (lun, 08 mar 2010) | 4 lines Backport the Popen.poll() protection from subprocess to multiprocessing. See #1731717. It should fix transient failures on test_multiprocessing. ........ r78787 | florent.xicluna | 2010-03-08 08:21:16 +0100 (lun, 08 mar 2010) | 2 lines Don't fail on a debug() statement, if the worker PID is (still) None. ........ r78790 | florent.xicluna | 2010-03-08 12:01:39 +0100 (lun, 08 mar 2010) | 2 lines On finalize, don't try to join not started process. ........
Diffstat (limited to 'Lib/multiprocessing/forking.py')
-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 3c0f568..5d66fa3 100644
--- a/Lib/multiprocessing/forking.py
+++ b/Lib/multiprocessing/forking.py
@@ -104,7 +104,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)