fix bytes compile time constants in Py3
authorStefan Behnel <scoder@users.berlios.de>
Fri, 21 Aug 2009 11:59:12 +0000 (13:59 +0200)
committerStefan Behnel <scoder@users.berlios.de>
Fri, 21 Aug 2009 11:59:12 +0000 (13:59 +0200)
Cython/Compiler/Parsing.py

index 7245c6d255a4760cd891dd7399828a5e4edb81c2..4e7ad711895e900abb58904c7cc2ceadd9a6be90 100644 (file)
@@ -14,7 +14,7 @@ from Cython.Compiler.Scanning import PyrexScanner, FileSourceDescriptor
 import Nodes
 import ExprNodes
 import StringEncoding
-from StringEncoding import EncodedString, BytesLiteral
+from StringEncoding import EncodedString, BytesLiteral, _str, _bytes
 from ModuleNode import ModuleNode
 from Errors import error, warning, InternalError
 from Cython import Utils
@@ -571,7 +571,7 @@ def p_name(s, name):
             return ExprNodes.IntNode(pos, value = rep, longness = "L")
         elif isinstance(value, float):
             return ExprNodes.FloatNode(pos, value = rep)
-        elif isinstance(value, (str, unicode)):
+        elif isinstance(value, (_str, _bytes)):
             return ExprNodes.StringNode(pos, value = value)
         else:
             error(pos, "Invalid type for compile-time constant: %s"