From 9baaa6bf3d54c8513c62f3517d202019c36bdd66 Mon Sep 17 00:00:00 2001 From: Craig Citro Date: Tue, 9 Feb 2010 22:01:34 -0800 Subject: [PATCH] Fix for #505 mistakenly treated things like "cimport cythontools" as a cython import. --- Cython/Compiler/ParseTreeTransforms.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Cython/Compiler/ParseTreeTransforms.py b/Cython/Compiler/ParseTreeTransforms.py index 3dd4847c..3ac10588 100644 --- a/Cython/Compiler/ParseTreeTransforms.py +++ b/Cython/Compiler/ParseTreeTransforms.py @@ -395,7 +395,8 @@ class InterpretCompilerDirectives(CythonTransform, SkipDeclarations): return node def visit_FromCImportStatNode(self, node): - if node.module_name.startswith(u"cython"): + if (node.module_name == u"cython") or \ + node.module_name.startswith(u"cython."): submodule = (node.module_name + u".")[7:] newimp = [] for pos, name, as_name, kind in node.imported_names: @@ -415,7 +416,8 @@ class InterpretCompilerDirectives(CythonTransform, SkipDeclarations): return node def visit_FromImportStatNode(self, node): - if node.module.module_name.value.startswith(u"cython"): + if (node.module.module_name.value == u"cython") or \ + node.module.module_name.value.startswith(u"cython."): submodule = (node.module.module_name.value + u".")[7:] newimp = [] for name, name_node in node.items: -- 2.26.2