Skip to content

Commit

Permalink
tests: fix capture_stdio() for Python 2.7
Browse files Browse the repository at this point in the history
  • Loading branch information
geertj committed Jun 14, 2017
1 parent e56c630 commit 1d77ca4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/support.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit 1d77ca4

Please sign in to comment.