From: Stefan Behnel Date: Fri, 21 Aug 2009 08:44:15 +0000 (+0200) Subject: Py2.x fix after Py3 char fix ;) X-Git-Tag: 0.12.alpha0~240 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=6ecf24a85ccc5134b15ec31cc2d2ba607a6fa46e;p=cython.git Py2.x fix after Py3 char fix ;) --- diff --git a/Cython/Compiler/StringEncoding.py b/Cython/Compiler/StringEncoding.py index dcb5079c..3df6ffcc 100644 --- a/Cython/Compiler/StringEncoding.py +++ b/Cython/Compiler/StringEncoding.py @@ -49,16 +49,16 @@ class BytesLiteralBuilder(object): self.chars.append(characters) 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): - # this *must* return a byte string! => fix it in Py3k!! + # this *must* return a byte string! s = BytesLiteral(join_bytes(self.chars)) s.encoding = self.target_encoding return s def getchar(self): - # this *must* return a byte string! => fix it in Py3k!! + # this *must* return a byte string! return self.getstring() class EncodedString(_str):