STINNER Victor added the comment: redirect_stdout("stderr", stream) looks wrong to be: you want to redirect "stdout" or "stderr"?
If you want to redirect something else (ex: stdin), you can still implement the very simple pattern: old_stdin = sys.stdin try: sys.stdin = mock_input ... finally: sys.stdin = old_stdin By the way, I'm not convinced that we should add redirect_stderr. @Barry: How many usage of this new functions do you see in the standard library? ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue22389> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com