Skip to content

Commit 7e0653b

Browse files
committed
Use io.BytesIO instead of StringsIO.StringsIO
Signed-off-by: Sebastian Ramacher <sebastian+dev@ramacher.at>
1 parent 2afe1d0 commit 7e0653b

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

bpython/test/test_curtsies_repl.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
from contextlib import contextmanager
66
from mock import Mock, patch, MagicMock
77
import os
8-
from StringIO import StringIO
98
import sys
109
import tempfile
1110

@@ -14,6 +13,11 @@
1413
except ImportError:
1514
import unittest
1615

16+
try:
17+
from io import BytesIO
18+
except ImportError:
19+
from StringIO import StringIO as BytesIO
20+
1721
from bpython.curtsiesfrontend import repl as curtsiesrepl
1822
from bpython.curtsiesfrontend import interpreter
1923
from bpython import autocomplete
@@ -201,7 +205,7 @@ def test_list_win_not_visible_and_match_selected_if_one_option(self):
201205

202206
@contextmanager # from http://stackoverflow.com/a/17981937/398212 - thanks @rkennedy
203207
def captured_output():
204-
new_out, new_err = StringIO(), StringIO()
208+
new_out, new_err = BytesIO(), BytesIO()
205209
old_out, old_err = sys.stdout, sys.stderr
206210
try:
207211
sys.stdout, sys.stderr = new_out, new_err

0 commit comments

Comments
 (0)