Skip to content

Commit

Permalink
pythonGH-88050: fix race in closing subprocess pipe in asyncio (pytho…
Browse files Browse the repository at this point in the history
…nGH-97951)

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

Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
  • Loading branch information
kumaraditya303 authored and miss-islington committed Oct 6, 2022
1 parent 4aa93af commit 2e5886a
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 2e5886a

Please sign in to comment.