Commits

Takeshi Komiya committed af14710

Fix capturing stderr outputs in py2.x

  • Participants
  • Parent commits ffaa80c

Comments (0)

Files changed (1)

File src/blockdiag/tests/utils.py

 from blockdiag.parser import parse_file
 
 try:
+    # sys.stderr in py2.x allows mixture of str and unicode
+    from cStringIO import StringIO
+except ImportError:
+    # sys.stderr in py3.x allows only str objects (disallow bytes objs)
     from io import StringIO
-except ImportError:
-    from cStringIO import StringIO
 
 
 def supported_pil():