Commit 1c36f361 authored by Stefan Behnel's avatar Stefan Behnel

keep constant_result when coercing string to char

parent 20f67300
......@@ -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:
......
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