]> granicus.if.org Git - python/commitdiff
In collect_children(), put a try-except around os.waitpid() because it
authorGuido van Rossum <guido@python.org>
Thu, 17 Jun 1999 15:41:33 +0000 (15:41 +0000)
committerGuido van Rossum <guido@python.org>
Thu, 17 Jun 1999 15:41:33 +0000 (15:41 +0000)
may raise an exception (when there are no children).  Reported by
Andy Dustman.

Lib/SocketServer.py

index 1ede68d52660604352dc43d7c4f7cc960d874105..82bc8fb7a28479bb1ec8fa7ddc6da19f21a6f8bb 100644 (file)
@@ -285,7 +285,10 @@ class ForkingMixIn:
     def collect_children(self):
         """Internal routine to wait for died 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
             self.active_children.remove(pid)