Skip to content

Commit

Permalink
GH-88050: fix race in closing subprocess pipe in asyncio (#97951)
Browse files Browse the repository at this point in the history
Check for None when iterating over `self._pipes.values()`.
  • Loading branch information
kumaraditya303 authored Oct 6, 2022
1 parent f612565 commit e2e6b95
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 e2e6b95

Please sign in to comment.