Commit 6ecf24a8 authored by Stefan Behnel's avatar Stefan Behnel

Py2.x fix after Py3 char fix ;)

parent aee044e8
...@@ -49,16 +49,16 @@ class BytesLiteralBuilder(object): ...@@ -49,16 +49,16 @@ class BytesLiteralBuilder(object):
self.chars.append(characters) self.chars.append(characters)
def append_charval(self, char_number): def append_charval(self, char_number):
self.chars.append( chr(char_number).encode('ISO-8859-1') ) self.chars.append( unichr(char_number).encode('ISO-8859-1') )
def getstring(self): def getstring(self):
# this *must* return a byte string! => fix it in Py3k!! # this *must* return a byte string!
s = BytesLiteral(join_bytes(self.chars)) s = BytesLiteral(join_bytes(self.chars))
s.encoding = self.target_encoding s.encoding = self.target_encoding
return s return s
def getchar(self): def getchar(self):
# this *must* return a byte string! => fix it in Py3k!! # this *must* return a byte string!
return self.getstring() return self.getstring()
class EncodedString(_str): class EncodedString(_str):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment