1. blockdiag
  2. Untitled project
  3. blockdiag

Commits

Takeshi Komiya  committed af14710

Fix capturing stderr outputs in py2.x

  • Participants
  • Parent commits ffaa80c
  • Branches default

Comments (0)

Files changed (1)

File src/blockdiag/tests/utils.py

View file
 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():