goto error;
}
- Py_INCREF(st->filters);
- if (PyModule_AddObject(m, "filters", st->filters) < 0) {
+ if (PyModule_AddObjectRef(m, "filters", st->filters) < 0) {
goto error;
}
-
- Py_INCREF(st->once_registry);
- if (PyModule_AddObject(m, "_onceregistry", st->once_registry) < 0) {
+ if (PyModule_AddObjectRef(m, "_onceregistry", st->once_registry) < 0) {
goto error;
}
-
- Py_INCREF(st->default_action);
- if (PyModule_AddObject(m, "_defaultaction", st->default_action) < 0) {
+ if (PyModule_AddObjectRef(m, "_defaultaction", st->default_action) < 0) {
goto error;
}
def->m_base.m_init = p0;
/* Remember the filename as the __file__ attribute */
- if (PyModule_AddObject(m, "__file__", path) < 0)
+ if (PyModule_AddObjectRef(m, "__file__", path) < 0) {
PyErr_Clear(); /* Not important enough to report */
- else
- Py_INCREF(path);
+ }
PyObject *modules = PyImport_GetModuleDict();
if (_PyImport_FixupExtensionObject(m, name_unicode, path, modules) < 0)