From 72f162a432ca0ce069cb44de87cc0884a55a733d Mon Sep 17 00:00:00 2001 From: Stefan Behnel Date: Fri, 21 Aug 2009 13:59:12 +0200 Subject: [PATCH] fix bytes compile time constants in Py3 --- Cython/Compiler/Parsing.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cython/Compiler/Parsing.py b/Cython/Compiler/Parsing.py index 7245c6d2..4e7ad711 100644 --- a/Cython/Compiler/Parsing.py +++ b/Cython/Compiler/Parsing.py @@ -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" -- 2.26.2