Commit 72f162a4 authored by Stefan Behnel's avatar Stefan Behnel

fix bytes compile time constants in Py3

parent 021322cf
...@@ -14,7 +14,7 @@ from Cython.Compiler.Scanning import PyrexScanner, FileSourceDescriptor ...@@ -14,7 +14,7 @@ from Cython.Compiler.Scanning import PyrexScanner, FileSourceDescriptor
import Nodes import Nodes
import ExprNodes import ExprNodes
import StringEncoding import StringEncoding
from StringEncoding import EncodedString, BytesLiteral from StringEncoding import EncodedString, BytesLiteral, _str, _bytes
from ModuleNode import ModuleNode from ModuleNode import ModuleNode
from Errors import error, warning, InternalError from Errors import error, warning, InternalError
from Cython import Utils from Cython import Utils
...@@ -571,7 +571,7 @@ def p_name(s, name): ...@@ -571,7 +571,7 @@ def p_name(s, name):
return ExprNodes.IntNode(pos, value = rep, longness = "L") return ExprNodes.IntNode(pos, value = rep, longness = "L")
elif isinstance(value, float): elif isinstance(value, float):
return ExprNodes.FloatNode(pos, value = rep) return ExprNodes.FloatNode(pos, value = rep)
elif isinstance(value, (str, unicode)): elif isinstance(value, (_str, _bytes)):
return ExprNodes.StringNode(pos, value = value) return ExprNodes.StringNode(pos, value = value)
else: else:
error(pos, "Invalid type for compile-time constant: %s" error(pos, "Invalid type for compile-time constant: %s"
......
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