mirror of https://github.com/python/cpython
Guard the _active.remove() call to avoid errors when there is no _active list.
This commit is contained in:
parent
a85bf202ac
commit
cfecd599b6
|
@ -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):
|
||||
|
|
Loading…
Reference in New Issue