From e7749abdf95154fb9a40ad686bf7a302b66c21f7 Mon Sep 17 00:00:00 2001 From: Andrew Murray Date: Fri, 7 May 2021 20:44:46 +1000 Subject: [PATCH] Corrected error in restoring sys.stdout --- Tests/test_file_png.py | 2 +- Tests/test_psdraw.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Tests/test_file_png.py b/Tests/test_file_png.py index 14ad6fae1..15d74ca6b 100644 --- a/Tests/test_file_png.py +++ b/Tests/test_file_png.py @@ -715,7 +715,7 @@ class TestFilePng: @pytest.mark.parametrize("buffer", (True, False)) def test_save_stdout(self, buffer): - old_stdout = sys.stdout.buffer + old_stdout = sys.stdout if buffer: diff --git a/Tests/test_psdraw.py b/Tests/test_psdraw.py index cda6a2be1..e74d79828 100644 --- a/Tests/test_psdraw.py +++ b/Tests/test_psdraw.py @@ -49,7 +49,7 @@ def test_draw_postscript(tmp_path): @pytest.mark.parametrize("buffer", (True, False)) def test_stdout(buffer): # Temporarily redirect stdout - old_stdout = sys.stdout.buffer + old_stdout = sys.stdout if buffer: