We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fc509e6 commit c43e264Copy full SHA for c43e264
src/PythonQt.cpp
@@ -2137,8 +2137,9 @@ PyObject* PythonQtPrivate::packageByName(const char* name)
2137
v = PyImport_AddModule((_pythonQtModuleName + "." + name).constData());
2138
_packages.insert(name, v);
2139
// AddObject steals the reference, so increment it!
2140
- Py_INCREF(v);
2141
- PyModule_AddObject(_pythonQtModule, name, v);
+ if (PyModule_AddObject(_pythonQtModule, name, v) == 0) {
+ Py_INCREF(v);
2142
+ }
2143
}
2144
return v;
2145
0 commit comments