1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-24 21:34:56 +03:00

Add aliases for StringIO.StringIO

cStringIO doesn't handle unicode, StringIO does. With py2/py3
compatable code we can easily find ourselves getting passed
unicode so we don't alias cStringIO

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
This commit is contained in:
Noel Power 2018-04-17 13:52:58 +01:00 committed by Noel Power
parent d2ee36e350
commit d331ddf47f

View File

@ -30,6 +30,10 @@ if PY3:
integer_types = int,
string_types = str
text_type = str
# alias
import io
StringIO = io.StringIO
else:
# compat functions
from urllib import quote as urllib_quote
@ -39,3 +43,7 @@ else:
integer_types = (int, long)
string_types = basestring
text_type = unicode
# alias
import StringIO
StringIO = StringIO.StringIO