Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions src/xmipp/bindings/python/xmippmodule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1502,8 +1502,8 @@ xmipp_methods[] =
{ nullptr } /* Sentinel */
};//xmipp_methods

#define INIT_TYPE(type) if (PyType_Ready(&type##Type) < 0) return module; Py_INCREF(&type##Type);\
PyModule_AddObject(module, #type, (PyObject *) &type##Type);
#define INIT_TYPE(type) if (PyType_Ready(&type##Type) < 0) return mymodule; Py_INCREF(&type##Type);\
PyModule_AddObject(mymodule, #type, (PyObject *) &type##Type);


static struct PyModuleDef moduledef = {
Expand All @@ -1516,11 +1516,11 @@ static struct PyModuleDef moduledef = {

PyMODINIT_FUNC
PyInit_xmippLib(void) {
//Initialize module variable
//Initialize mymodule variable

PyObject *module = PyModule_Create(&moduledef);
PyObject *mymodule = PyModule_Create(&moduledef);

//Check types and add to module
//Check types and add to mymodule
INIT_TYPE(FileName);
INIT_TYPE(Image);
INIT_TYPE(MDQuery);
Expand All @@ -1534,11 +1534,11 @@ PyInit_xmippLib(void) {
char message[32]="xmipp.XmippError";
PyXmippError = PyErr_NewException(message, nullptr, nullptr);
Py_INCREF(PyXmippError);
PyModule_AddObject(module, "XmippError", PyXmippError);
PyModule_AddObject(mymodule, "XmippError", PyXmippError);

//Add MDLabel constants
PyObject * dict = PyModule_GetDict(module);
PyObject * dict = PyModule_GetDict(mymodule);
addLabels(dict);

return module;
return mymodule;
}
Loading