]> granicus.if.org Git - python/commitdiff
Guard the _active.remove() call to avoid errors when there is no _active list.
authorGeorg Brandl <georg@python.org>
Thu, 25 May 2006 18:44:09 +0000 (18:44 +0000)
committerGeorg Brandl <georg@python.org>
Thu, 25 May 2006 18:44:09 +0000 (18:44 +0000)
Lib/popen2.py

index 67ebd26dd64e565868990d61efb2851d0a42fe3d..b966d4c80eb1f47bfee141eb2efe25a6a8140129 100644 (file)
@@ -72,8 +72,9 @@ class Popen3:
         # In case the child hasn't been waited on, check if it's done.
         self.poll(_deadstate=sys.maxint)
         if self.sts < 0:
-            # Child is still running, keep us alive until we can wait on it.
-            _active.append(self)
+            if _active:
+                # Child is still running, keep us alive until we can wait on it.
+                _active.append(self)
 
     def _run_child(self, cmd):
         if isinstance(cmd, basestring):