summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2006-05-25 18:44:09 (GMT)
committerGeorg Brandl <georg@python.org>2006-05-25 18:44:09 (GMT)
commitcfecd599b6dbcc7939560e6ca0a74b4223b389e2 (patch)
tree45f48bb834bc796b4a2515ef3fc5fad454544f9b /Lib
parenta85bf202ac57e4d8013a12b13928cccb8fbc5fa4 (diff)
downloadcpython-cfecd599b6dbcc7939560e6ca0a74b4223b389e2.zip
cpython-cfecd599b6dbcc7939560e6ca0a74b4223b389e2.tar.gz
cpython-cfecd599b6dbcc7939560e6ca0a74b4223b389e2.tar.bz2
Guard the _active.remove() call to avoid errors when there is no _active list.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/popen2.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/Lib/popen2.py b/Lib/popen2.py
index 67ebd26..b966d4c 100644
--- a/Lib/popen2.py
+++ b/Lib/popen2.py
@@ -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):