[Python-checkins] cpython (merge default -> default): Merge heads
serhiy.storchaka
python-checkins at python.org
Wed Aug 21 20:56:40 CEST 2013
http://hg.python.org/cpython/rev/6ea8b8671f73
changeset: 85299:6ea8b8671f73
parent: 85297:b500daaee7d0
parent: 85295:e1fdd79cfb01
user: Serhiy Storchaka <storchaka at gmail.com>
date: Wed Aug 21 21:52:50 2013 +0300
summary:
Merge heads
files:
Lib/multiprocessing/forkserver.py | 15 +++++++++++++++
Lib/test/_test_multiprocessing.py | 6 ++++--
2 files changed, 19 insertions(+), 2 deletions(-)
diff --git a/Lib/multiprocessing/forkserver.py b/Lib/multiprocessing/forkserver.py
--- a/Lib/multiprocessing/forkserver.py
+++ b/Lib/multiprocessing/forkserver.py
@@ -66,6 +66,21 @@
try:
reduction.sendfds(client, allfds)
return parent_r, parent_w
+ except OSError:
+ # XXX This is debugging info for Issue #18762
+ import fcntl
+ L = []
+ for fd in allfds:
+ try:
+ flags = fcntl.fcntl(fd, fcntl.F_GETFL)
+ except OSError as e:
+ L.append((fd, e))
+ else:
+ L.append((fd, flags))
+ print('*** connect_to_new_process: %r' % L, file=sys.stderr)
+ os.close(parent_r)
+ os.close(parent_w)
+ raise
except:
os.close(parent_r)
os.close(parent_w)
diff --git a/Lib/test/_test_multiprocessing.py b/Lib/test/_test_multiprocessing.py
--- a/Lib/test/_test_multiprocessing.py
+++ b/Lib/test/_test_multiprocessing.py
@@ -3386,7 +3386,8 @@
if n > 1:
p = multiprocessing.Process(target=cls.child, args=(n-1, conn))
p.start()
- p.join()
+ conn.close()
+ p.join(timeout=5)
else:
conn.send(len(util._afterfork_registry))
conn.close()
@@ -3397,8 +3398,9 @@
old_size = len(util._afterfork_registry)
p = multiprocessing.Process(target=self.child, args=(5, w))
p.start()
+ w.close()
new_size = r.recv()
- p.join()
+ p.join(timeout=5)
self.assertLessEqual(new_size, old_size)
#
--
Repository URL: http://hg.python.org/cpython
More information about the Python-checkins
mailing list