Browse Source

interrogate: use fully qualified module name in PyModule_Create

This is helpful when static linking and explicitly initializing the modules.

Closes #308
pmp-p 6 years ago
parent
commit
8615e25a12

+ 1 - 1
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"

+ 1 - 1
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"