From 836a678939e7560be453a69e0faddf02ae5a4656 Mon Sep 17 00:00:00 2001 From: Stefan Behnel Date: Tue, 1 Jun 2010 08:54:37 +0200 Subject: [PATCH] temp var names in the TemplateTransform may become user visible, so they must be encoded as identifiers --- Cython/Compiler/TreeFragment.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Cython/Compiler/TreeFragment.py b/Cython/Compiler/TreeFragment.py index 66feaf09..6da04ac9 100644 --- a/Cython/Compiler/TreeFragment.py +++ b/Cython/Compiler/TreeFragment.py @@ -14,6 +14,7 @@ from ExprNodes import NameNode import Parsing import Main import UtilNodes +import StringEncoding """ Support for parsing strings into code trees. @@ -120,7 +121,7 @@ class TemplateTransform(VisitorTransform): temphandles = [] for temp in temps: TemplateTransform.temp_name_counter += 1 - handle = "__tmpvar_%d" % TemplateTransform.temp_name_counter + handle = StringEncoding.EncodedString("__tmpvar_%d" % TemplateTransform.temp_name_counter) # handle = UtilNodes.TempHandle(PyrexTypes.py_object_type) tempmap[temp] = handle # temphandles.append(handle) -- 2.26.2