From: Guido van Rossum Date: Thu, 17 Jun 1999 15:41:33 +0000 (+0000) Subject: In collect_children(), put a try-except around os.waitpid() because it X-Git-Tag: v1.6a1~1205 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=bfadac00ef54264ef74313a7f6b527a946b62670;p=thirdparty%2FPython%2Fcpython.git 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. --- diff --git a/Lib/SocketServer.py b/Lib/SocketServer.py index 1ede68d52660..82bc8fb7a284 100644 --- a/Lib/SocketServer.py +++ b/Lib/SocketServer.py @@ -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)