diff options
author | Georg Brandl <georg@python.org> | 2006-05-25 18:44:09 (GMT) |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2006-05-25 18:44:09 (GMT) |
commit | cfecd599b6dbcc7939560e6ca0a74b4223b389e2 (patch) | |
tree | 45f48bb834bc796b4a2515ef3fc5fad454544f9b /Lib/popen2.py | |
parent | a85bf202ac57e4d8013a12b13928cccb8fbc5fa4 (diff) | |
download | cpython-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/popen2.py')
-rw-r--r-- | Lib/popen2.py | 5 |
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): |