summaryrefslogtreecommitdiff
path: root/Cython/Compiler/ModuleNode.py
diff options
context:
space:
mode:
Diffstat (limited to 'Cython/Compiler/ModuleNode.py')
-rw-r--r--Cython/Compiler/ModuleNode.py10
1 files changed, 2 insertions, 8 deletions
diff --git a/Cython/Compiler/ModuleNode.py b/Cython/Compiler/ModuleNode.py
index f89af8ca5..176e4afe0 100644
--- a/Cython/Compiler/ModuleNode.py
+++ b/Cython/Compiler/ModuleNode.py
@@ -2628,18 +2628,12 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
# packages require __path__, so all we can do is try to figure
# out the module path at runtime by rerunning the import lookup
code.putln("if (!CYTHON_PEP489_MULTI_PHASE_INIT) {")
- package_name, _ = self.full_module_name.rsplit('.', 1)
- if '.' in package_name:
- parent_name = '"%s"' % (package_name.rsplit('.', 1)[0],)
- else:
- parent_name = 'NULL'
code.globalstate.use_utility_code(UtilityCode.load(
"SetPackagePathFromImportLib", "ImportExport.c"))
code.putln(code.error_goto_if_neg(
- '__Pyx_SetPackagePathFromImportLib(%s, %s)' % (
- parent_name,
+ '__Pyx_SetPackagePathFromImportLib(%s)' % (
code.globalstate.get_py_string_const(
- EncodedString(env.module_name)).cname),
+ self.full_module_name).cname),
self.pos))
code.putln("}")