add support for pypy3

This commit is contained in:
Xiaojie Lin 2014-11-14 14:47:03 +11:00
parent ef3f94101a
commit d5e9ac9316
2 changed files with 5 additions and 2 deletions

View file

@ -23,7 +23,10 @@ if hasattr(sys, 'pypy_version_info'):
# cStringIO is slow on PyPy, StringIO is faster. However: PyPy's own
# StringBuilder is fastest.
from __pypy__ import newlist_hint
from __pypy__.builders import StringBuilder
try:
from __pypy__.builders import BytesBuilder as StringBuilder
except ImportError:
from __pypy__.builders import StringBuilder
USING_STRINGBUILDER = True
class StringIO(object):
def __init__(self, s=b''):