From 9ed63c607ea8093d0a86bd848a5371562b7573c8 Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Sat, 17 Nov 2018 10:55:31 +0100 Subject: [PATCH] capture: do not overwrite `sys.__stdin__` etc Ref: https://github.com/pytest-dev/pytest/pull/4398#discussion_r234333053 --- src/_pytest/capture.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/_pytest/capture.py b/src/_pytest/capture.py index ec72ae3ec..679eb4d16 100644 --- a/src/_pytest/capture.py +++ b/src/_pytest/capture.py @@ -770,9 +770,9 @@ def _py36_windowsconsoleio_workaround(stream): f.line_buffering, ) - sys.__stdin__ = sys.stdin = _reopen_stdio(sys.stdin, "rb") - sys.__stdout__ = sys.stdout = _reopen_stdio(sys.stdout, "wb") - sys.__stderr__ = sys.stderr = _reopen_stdio(sys.stderr, "wb") + sys.stdin = _reopen_stdio(sys.stdin, "rb") + sys.stdout = _reopen_stdio(sys.stdout, "wb") + sys.stderr = _reopen_stdio(sys.stderr, "wb") def _attempt_to_close_capture_file(f):