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
…n#97951)

Check for None when iterating over `self._pipes.values()`.
  • Loading branch information
kumaraditya303 authored and lysnikolaou committed Oct 6, 2022
1 parent 0261165 commit 25c1004
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 25c1004

Please sign in to comment.