[Python-checkins] r46238 - python/trunk/Lib/popen2.py

georg.brandl python-checkins at python.org
Thu May 25 20:44:10 CEST 2006


Author: georg.brandl
Date: Thu May 25 20:44:09 2006
New Revision: 46238

Modified:
   python/trunk/Lib/popen2.py
Log:
Guard the _active.remove() call to avoid errors when there is no _active list.



Modified: python/trunk/Lib/popen2.py
==============================================================================
--- python/trunk/Lib/popen2.py	(original)
+++ python/trunk/Lib/popen2.py	Thu May 25 20:44:09 2006
@@ -72,8 +72,9 @@
         # 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):


More information about the Python-checkins mailing list