six: py3compat.py: use efficient py2 BytesIO version
@@ -19,7 +19,7 @@ from six import integer_types
from six import string_types
from six import text_type
-from six import BytesIO
+# from six import BytesIO # see below!
from six import StringIO
from six.moves import cPickle
@@ -80,6 +80,8 @@ if PY3:
long_type = int
+ from io import BytesIO
+
# Abstract u'abc' syntax:
@_modify_str_or_docstring
def format_doctest_out(s):
@@ -134,6 +136,8 @@ else:
long_type = long
+ from cStringIO import StringIO as BytesIO
+
# Abstract u'abc' syntax:
@_modify_str_or_docstring
def format_doctest_out(s):
