pytester: always close stdin pipe in pytester.run()

If the user passed stdin=PIPE for some reason, they have no way to close
it themselves since it is not exposed.
This commit is contained in:
Ran Benita 2020-11-20 17:50:58 +02:00
parent 3e0bbd2f57
commit 148e3c582a
1 changed files with 1 additions and 1 deletions

View File

@ -1349,7 +1349,7 @@ class Pytester:
stderr=f2, stderr=f2,
close_fds=(sys.platform != "win32"), close_fds=(sys.platform != "win32"),
) )
if isinstance(stdin, bytes): if popen.stdin is not None:
popen.stdin.close() popen.stdin.close()
def handle_timeout() -> None: def handle_timeout() -> None: