mirror of
https://github.com/python/cpython.git
synced 2025-08-01 07:33:08 +00:00
Issue #12650: Fix a race condition where a subprocess.Popen could leak
resources (FD/zombie) when killed at the wrong time.
This commit is contained in:
parent
02ebf4f78b
commit
b02302c5cf
3 changed files with 61 additions and 1 deletions
|
@ -460,7 +460,7 @@ _active = []
|
|||
def _cleanup():
|
||||
for inst in _active[:]:
|
||||
res = inst._internal_poll(_deadstate=sys.maxint)
|
||||
if res is not None and res >= 0:
|
||||
if res is not None:
|
||||
try:
|
||||
_active.remove(inst)
|
||||
except ValueError:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue