From 6ecf24a85ccc5134b15ec31cc2d2ba607a6fa46e Mon Sep 17 00:00:00 2001 From: Stefan Behnel Date: Fri, 21 Aug 2009 10:44:15 +0200 Subject: [PATCH] Py2.x fix after Py3 char fix ;) --- Cython/Compiler/StringEncoding.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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): -- 2.26.2