summaryrefslogtreecommitdiffstats
path: root/Lib/popen2.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/popen2.py')
-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):