Skip to content

Commit bd3dcb3

Browse files
[3.11] GH-88050: fix race in closing subprocess pipe in asyncio (GH-97951) (#97978)
Check for None when iterating over `self._pipes.values()`. (cherry picked from commit e2e6b95) Co-authored-by: Kumar Aditya <[email protected]>
1 parent 1cd19f7 commit bd3dcb3

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)