From: Craig Citro Date: Wed, 10 Feb 2010 06:01:34 +0000 (-0800) Subject: Fix for #505 mistakenly treated things like "cimport cythontools" as a cython import. X-Git-Tag: 0.13.beta0~349^2~4 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=9baaa6bf3d54c8513c62f3517d202019c36bdd66;p=cython.git Fix for #505 mistakenly treated things like "cimport cythontools" as a cython import. --- 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: