diff options
author | Guido van Rossum <guido@python.org> | 1999-06-17 15:41:33 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 1999-06-17 15:41:33 (GMT) |
commit | bfadac00ef54264ef74313a7f6b527a946b62670 (patch) | |
tree | cac47e7c5aeb61fad6bf3b2d6ed958408277322c /Lib/SocketServer.py | |
parent | 873f0297c36e8a8096fb49f0e1b5062b194416fd (diff) | |
download | cpython-bfadac00ef54264ef74313a7f6b527a946b62670.zip cpython-bfadac00ef54264ef74313a7f6b527a946b62670.tar.gz cpython-bfadac00ef54264ef74313a7f6b527a946b62670.tar.bz2 |
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.
Diffstat (limited to 'Lib/SocketServer.py')
-rw-r--r-- | Lib/SocketServer.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Lib/SocketServer.py b/Lib/SocketServer.py index 1ede68d..82bc8fb 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) |