GH-88050: fix race in closing subprocess pipe in asyncio (#97951)

Check for None when iterating over `self._pipes.values()`.
This commit is contained in:
Kumar Aditya 2022-10-06 22:48:19 +05:30 committed by GitHub
parent f612565bd3
commit e2e6b95c03
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -216,7 +216,9 @@ class BaseSubprocessTransport(transports.SubprocessTransport):
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):