keep constant_result when coercing string to char
authorStefan Behnel <stefan_ml@behnel.de>
Sun, 12 May 2013 12:07:03 +0000 (14:07 +0200)
committerStefan Behnel <stefan_ml@behnel.de>
Sun, 12 May 2013 12:07:03 +0000 (14:07 +0200)
Cython/Compiler/ExprNodes.py

index f11c73a..860cda8 100755 (executable)
@@ -1154,7 +1154,8 @@ class BytesNode(ConstNode):
             if dst_type.is_unicode_char:
                 error(self.pos, "Bytes literals cannot coerce to Py_UNICODE/Py_UCS4, use a unicode literal instead.")
                 return self
-            return CharNode(self.pos, value=self.value)
+            return CharNode(self.pos, value=self.value,
+                            constant_result=ord(self.value))
 
         node = BytesNode(self.pos, value=self.value)
         if dst_type.is_pyobject: