changeset 57970:ec8bb1514d67

fix test on py3
author Benjamin Peterson <benjamin@python.org>
date Tue, 29 Dec 2009 00:37:04 +0000
parents f764e4126a23
children 15eac765cc35
files Lib/lib2to3/tests/test_main.py
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/Lib/lib2to3/tests/test_main.py	Tue Dec 29 00:06:20 2009 +0000
+++ b/Lib/lib2to3/tests/test_main.py	Tue Dec 29 00:37:04 2009 +0000
@@ -25,12 +25,12 @@
 
     def test_unencodable_diff(self):
         input_stream = io.StringIO("print 'nothing'\nprint u'über'\n")
-        out = io.StringIO()
+        out = io.BytesIO()
         out_enc = codecs.getwriter("ascii")(out)
         err = io.StringIO()
         ret = self.run_2to3_capture(["-"], input_stream, out_enc, err)
         self.assertEqual(ret, 0)
-        output = out.getvalue()
+        output = out.getvalue().decode("ascii")
         self.assertTrue("-print 'nothing'" in output)
         self.assertTrue("WARNING: couldn't encode <stdin>'s diff for "
                         "your terminal" in err.getvalue())