Skip to content

Commit a53f78f

Browse files
committed
testing/test_functional.py: Use sys.stdout.buffer for Python 3 instead of sys.stdout
because Python 3's sys.stdout takes unicode; not bytes.
1 parent ee767d8 commit a53f78f

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

testing/test_functional.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,10 @@ def pytest_funcarg__child(request):
1313
except SyntaxError:
1414
pytest.skip('pexpect wont work on py3k')
1515
child = pexpect.spawn(sys.executable, ['-S'], timeout=10)
16-
child.logfile = sys.stdout
16+
if sys.version_info >= (3, ):
17+
child.logfile = sys.stdout.buffer
18+
else:
19+
child.logfile = sys.stdout
1720
child.sendline('from pyrepl.python_reader import main')
1821
child.sendline('main()')
1922
return child

0 commit comments

Comments
 (0)