]> granicus.if.org Git - python/commitdiff
Add diagnostic message to help figure-out why SocketServer tests occasionally crash
authorRaymond Hettinger <python@rcn.com>
Thu, 14 Feb 2008 09:32:45 +0000 (09:32 +0000)
committerRaymond Hettinger <python@rcn.com>
Thu, 14 Feb 2008 09:32:45 +0000 (09:32 +0000)
when trying to remove a pid that in not in the activechildren list.

Lib/SocketServer.py

index 2eed9144921f192456ac9df47c1bed18c7504020..1763c1d5e47caced85f19dfb647f38b5b1b019c6 100644 (file)
@@ -452,7 +452,11 @@ class ForkingMixIn:
             except os.error:
                 pid = None
             if not pid: break
-            self.active_children.remove(pid)
+            try:
+                self.active_children.remove(pid)
+            except ValueError, e:
+                raise ValueError('%s. x=%d and list=%r' % (e.message, pid,
+                                                           self.active_children))
 
     def handle_timeout(self):
         """Wait for zombies after self.timeout seconds of inactivity.