Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion Lib/asyncio/base_subprocess.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,12 @@ def close(self):
for proto in self._pipes.values():
if proto is None:
continue
proto.pipe.close()
# See gh-114177
# skip closing the pipe if loop is already closed
# this can happen e.g. when loop is closed immediately after
# process is killed
if self._loop and not self._loop.is_closed():
proto.pipe.close()

if (self._proc is not None and
# has the child process finished?
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix :mod:`asyncio` to not close subprocess pipes which would otherwise error out when the event loop is already closed.
Loading