From 8615e25a12d19187bfac562a610967f7ac1d0c23 Mon Sep 17 00:00:00 2001 From: pmp-p Date: Wed, 11 Dec 2019 16:24:36 +0100 Subject: [PATCH] interrogate: use fully qualified module name in PyModule_Create This is helpful when static linking and explicitly initializing the modules. Closes #308 --- dtool/src/interrogate/interfaceMakerPythonSimple.cxx | 2 +- dtool/src/interrogate/interrogate_module.cxx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dtool/src/interrogate/interfaceMakerPythonSimple.cxx b/dtool/src/interrogate/interfaceMakerPythonSimple.cxx index c0f1be390a..8a160216e8 100644 --- a/dtool/src/interrogate/interfaceMakerPythonSimple.cxx +++ b/dtool/src/interrogate/interfaceMakerPythonSimple.cxx @@ -98,7 +98,7 @@ write_module(ostream &out,ostream *out_h, InterrogateModuleDef *def) { << "#if PY_MAJOR_VERSION >= 3\n" << "static struct PyModuleDef python_simple_module = {\n" << " PyModuleDef_HEAD_INIT,\n" - << " \"" << def->library_name << "\",\n" + << " \"" << def->module_name << "\",\n" << " nullptr,\n" << " -1,\n" << " python_simple_funcs,\n" diff --git a/dtool/src/interrogate/interrogate_module.cxx b/dtool/src/interrogate/interrogate_module.cxx index 663e57762f..5b42d1db02 100644 --- a/dtool/src/interrogate/interrogate_module.cxx +++ b/dtool/src/interrogate/interrogate_module.cxx @@ -305,7 +305,7 @@ int write_python_table_native(std::ostream &out) { << "#if PY_MAJOR_VERSION >= 3\n" << "static struct PyModuleDef py_" << library_name << "_module = {\n" << " PyModuleDef_HEAD_INIT,\n" - << " \"" << library_name << "\",\n" + << " \"" << module_name << "\",\n" << " nullptr,\n" << " -1,\n" << " nullptr,\n"