From 9b11884b7e5b7039fe448d850ded78fb69ddb700 Mon Sep 17 00:00:00 2001 From: Robert Bradshaw Date: Fri, 23 May 2008 03:28:14 -0700 Subject: [PATCH] Some more unicode compile crash fixes. --- Cython/Compiler/Nodes.py | 2 +- Cython/Compiler/Symtab.py | 4 ++-- tests/compile/dotted_cimport.pyx | 2 ++ tests/compile/dotted_cimport_submodule/a.pxd | 0 4 files changed, 5 insertions(+), 3 deletions(-) create mode 100644 tests/compile/dotted_cimport.pyx create mode 100644 tests/compile/dotted_cimport_submodule/a.pxd diff --git a/Cython/Compiler/Nodes.py b/Cython/Compiler/Nodes.py index 8d0f2e06..db1370a0 100644 --- a/Cython/Compiler/Nodes.py +++ b/Cython/Compiler/Nodes.py @@ -3610,7 +3610,7 @@ class CImportStatNode(StatNode): return module_scope = env.find_module(self.module_name, self.pos) if "." in self.module_name: - names = self.module_name.split(".") + names = [EncodedString(name) for name in self.module_name.split(".")] top_name = names[0] top_module_scope = env.context.find_submodule(top_name) module_scope = top_module_scope diff --git a/Cython/Compiler/Symtab.py b/Cython/Compiler/Symtab.py index f1a01039..ba2e9d8c 100644 --- a/Cython/Compiler/Symtab.py +++ b/Cython/Compiler/Symtab.py @@ -1263,7 +1263,7 @@ class CClassScope(ClassScope): if name == "__new__": warning(pos, "__new__ method of extension type will change semantics " "in a future version of Pyrex and Cython. Use __cinit__ instead.") - name = "__cinit__" + name = Utils.EncodedString("__cinit__") entry = self.declare_var(name, py_object_type, pos) special_sig = get_special_method_signature(name) if special_sig: @@ -1280,7 +1280,7 @@ class CClassScope(ClassScope): def lookup_here(self, name): if name == "__new__": - name = "__cinit__" + name = Utils.EncodedString("__cinit__") return ClassScope.lookup_here(self, name) def declare_cfunction(self, name, type, pos, diff --git a/tests/compile/dotted_cimport.pyx b/tests/compile/dotted_cimport.pyx new file mode 100644 index 00000000..c9362671 --- /dev/null +++ b/tests/compile/dotted_cimport.pyx @@ -0,0 +1,2 @@ +cimport dotted_cimport_submodule.a +import dotted_cimport_submodule.b diff --git a/tests/compile/dotted_cimport_submodule/a.pxd b/tests/compile/dotted_cimport_submodule/a.pxd new file mode 100644 index 00000000..e69de29b -- 2.26.2