Fix build with Python 3 on Windows

This commit is contained in:
Matthias Hoelzl 2017-10-29 17:55:05 +01:00
parent 277e730d34
commit a6d53effa5
2 changed files with 11 additions and 5 deletions

View file

@ -12,6 +12,8 @@ if sys.version_info < (3,):
return cStringIO.StringIO()
def encode_utf8(x):
return x
def decode_utf8(x):
return x
def iteritems(d):
return d.iteritems()
def escape_string(s):
@ -38,6 +40,8 @@ else:
import codecs
def encode_utf8(x):
return codecs.utf_8_encode(x)[0]
def decode_utf8(x):
return codecs.utf_8_decode(x)[0]
def iteritems(d):
return iter(d.items())
def charcode_to_c_escapes(c):