From 1d77ca439600b6ea7a19aa1ee85dca0f3be3f3f8 Mon Sep 17 00:00:00 2001 From: Geert Jansen Date: Wed, 14 Jun 2017 17:52:59 -0400 Subject: [PATCH] tests: fix capture_stdio() for Python 2.7 --- tests/support.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/support.py b/tests/support.py index 13d6b79..8a52530 100644 --- a/tests/support.py +++ b/tests/support.py @@ -157,9 +157,9 @@ class capture_stdio(object): def __enter__(self): self.saved_stdout = sys.stdout - sys.stdout = io.StringIO() + sys.stdout = io.StringIO() if six.PY3 else io.BytesIO() self.saved_stderr = sys.stderr - sys.stderr = io.StringIO() + sys.stderr = io.StringIO() if six.PY3 else io.BytesIO() return (sys.stdout, sys.stderr) def __exit__(self, typ, val, tb):