gh-104340: Suppress warning about unawaited exception for closed pipe stdin (#104586)

This commit is contained in:
Guido van Rossum 2023-05-17 16:45:11 -07:00 committed by GitHub
parent b27fe67f3c
commit 7fc8e2d462
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 0 deletions

View file

@ -81,6 +81,9 @@ class SubprocessStreamProtocol(streams.FlowControlMixin,
self._stdin_closed.set_result(None)
else:
self._stdin_closed.set_exception(exc)
# Since calling `wait_closed()` is not mandatory,
# we shouldn't log the traceback if this is not awaited.
self._stdin_closed._log_traceback = False
return
if fd == 1:
reader = self.stdout