Skip to content

Commit

Permalink
[3.11] GH-88050: fix race in closing subprocess pipe in asyncio (GH-9…
Browse files Browse the repository at this point in the history
…7951) (#97978)

Check for None when iterating over `self._pipes.values()`.
(cherry picked from commit e2e6b95)

Co-authored-by: Kumar Aditya <[email protected]>
  • Loading branch information
miss-islington and kumaraditya303 authored Oct 6, 2022
1 parent 1cd19f7 commit bd3dcb3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Lib/asyncio/base_subprocess.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,9 @@ def _process_exited(self, returncode):
self._proc.returncode = returncode
self._call(self._protocol.process_exited)
for p in self._pipes.values():
p.pipe.close()
if p is not None:
p.pipe.close()

self._try_finish()

async def _wait(self):
Expand Down

0 comments on commit bd3dcb3

Please sign in to comment.