mirror of
https://github.com/python/cpython.git
synced 2025-08-31 05:58:33 +00:00
bpo-35459: Use PyDict_GetItemWithError() instead of PyDict_GetItem(). (GH-11112)
This commit is contained in:
parent
a180b007d9
commit
a24107b04c
31 changed files with 538 additions and 242 deletions
|
@ -2088,12 +2088,15 @@ cache_struct_converter(PyObject *fmt, PyStructObject **ptr)
|
|||
return 0;
|
||||
}
|
||||
|
||||
s_object = PyDict_GetItem(cache, fmt);
|
||||
s_object = PyDict_GetItemWithError(cache, fmt);
|
||||
if (s_object != NULL) {
|
||||
Py_INCREF(s_object);
|
||||
*ptr = (PyStructObject *)s_object;
|
||||
return Py_CLEANUP_SUPPORTED;
|
||||
}
|
||||
else if (PyErr_Occurred()) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
s_object = PyObject_CallFunctionObjArgs((PyObject *)(&PyStructType), fmt, NULL);
|
||||
if (s_object != NULL) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue