interrogate: use fully qualified module name in PyModule_Create

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

Closes #308
This commit is contained in:
pmp-p 2019-12-11 16:24:36 +01:00 committed by rdb
parent cf4d418f2f
commit 8615e25a12
2 changed files with 2 additions and 2 deletions

View File

@ -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"

View File

@ -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"