From 70bb2a3e1b9dee1a8135015ea810afe8e4c85fe4 Mon Sep 17 00:00:00 2001 From: Stefan Behnel Date: Tue, 13 May 2008 11:32:00 +0200 Subject: [PATCH] identifiers are encoded strings --- Cython/Compiler/Scanning.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Cython/Compiler/Scanning.py b/Cython/Compiler/Scanning.py index 278b8a73..67016d99 100644 --- a/Cython/Compiler/Scanning.py +++ b/Cython/Compiler/Scanning.py @@ -11,7 +11,7 @@ import stat import sys from time import time -from Cython import Plex +from Cython import Plex, Utils from Cython.Plex import Scanner from Cython.Plex.Errors import UnrecognizedInput from Errors import CompileError, error @@ -320,8 +320,12 @@ class PyrexScanner(Scanner): sy, systring = self.read() except UnrecognizedInput: self.error("Unrecognized character") - if sy == 'IDENT' and systring in self.resword_dict: - sy = systring + if sy == 'IDENT': + if systring in self.resword_dict: + sy = systring + else: + systring = Utils.EncodedString(systring) + systring.encoding = self.source_encoding self.sy = sy self.systring = systring if debug_scanner: -- 2.26.2