Skip to content

Commit e2e6b95

Browse files
GH-88050: fix race in closing subprocess pipe in asyncio (#97951)
Check for None when iterating over `self._pipes.values()`.
1 parent f612565 commit e2e6b95

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Lib/asyncio/base_subprocess.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,9 @@ def _process_exited(self, returncode):
216216
self._proc.returncode = returncode
217217
self._call(self._protocol.process_exited)
218218
for p in self._pipes.values():
219-
p.pipe.close()
219+
if p is not None:
220+
p.pipe.close()
221+
220222
self._try_finish()
221223

222224
async def _wait(self):

0 commit comments

Comments
 (0)