Kaydet (Commit) 84f2c325 authored tarafından Jesus Cea's avatar Jesus Cea

Issue #9675: better error handling in bsddb

üst 33c722b7
......@@ -9976,8 +9976,21 @@ PyMODINIT_FUNC PyInit__bsddb(void) /* Note the two underscores */
}
#endif
PyDict_SetItemString(d, "api", py_api);
Py_DECREF(py_api);
/* Check error control */
/*
** PyErr_NoMemory();
** py_api = NULL;
*/
if (py_api) {
PyDict_SetItemString(d, "api", py_api);
Py_DECREF(py_api);
} else { /* Something bad happened */
PyErr_WriteUnraisable(m);
PyErr_Warn(PyExc_RuntimeWarning,
"_bsddb/_pybsddb C API will be not available");
PyErr_Clear();
}
/* Check for errors */
if (PyErr_Occurred()) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment