Commit bfadac00 authored by Guido van Rossum's avatar Guido van Rossum

In collect_children(), put a try-except around os.waitpid() because it

may raise an exception (when there are no children).  Reported by
Andy Dustman.
parent 873f0297
...@@ -285,7 +285,10 @@ class ForkingMixIn: ...@@ -285,7 +285,10 @@ class ForkingMixIn:
def collect_children(self): def collect_children(self):
"""Internal routine to wait for died children.""" """Internal routine to wait for died children."""
while self.active_children: while self.active_children:
pid, status = os.waitpid(0, os.WNOHANG) try:
pid, status = os.waitpid(0, os.WNOHANG)
except os.error:
pid = None
if not pid: break if not pid: break
self.active_children.remove(pid) self.active_children.remove(pid)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment