]> git.ipfire.org Git - thirdparty/tornado.git/commitdiff
Fix precedence of StringIO imports for LogTrapTestCase.
authorBen Darnell <ben@bendarnell.com>
Wed, 3 Apr 2013 00:29:34 +0000 (20:29 -0400)
committerBen Darnell <ben@bendarnell.com>
Wed, 3 Apr 2013 00:30:41 +0000 (20:30 -0400)
io.StringIO doesn't allow byte strings even on python 2, which causes
it to fail with the standard log formatter (but not tornado's "pretty
logging").

Closes #708.

tornado/testing.py

index b7d2881e91ecdec1267724cd61c2c4538b583095..61c8430611edb028dfc77b61c959179b58248218 100644 (file)
@@ -40,9 +40,9 @@ import socket
 import sys
 
 try:
-    from io import StringIO  # py3
-except ImportError:
     from cStringIO import StringIO  # py2
+except ImportError:
+    from io import StringIO  # py3
 
 # Tornado's own test suite requires the updated unittest module
 # (either py27+ or unittest2) so tornado.test.util enforces