Commit 5b3b1006 authored by Victor Stinner's avatar Victor Stinner

Issue #18520: Fix _PyDict_GetItemId(), suppress _PyUnicode_FromId() error

As PyDict_GetItem(), _PyDict_GetItemId() suppresses all errors that may occur,
for historical reasons.
parent 34f96b8d
...@@ -2684,8 +2684,10 @@ _PyDict_GetItemId(PyObject *dp, struct _Py_Identifier *key) ...@@ -2684,8 +2684,10 @@ _PyDict_GetItemId(PyObject *dp, struct _Py_Identifier *key)
{ {
PyObject *kv; PyObject *kv;
kv = _PyUnicode_FromId(key); /* borrowed */ kv = _PyUnicode_FromId(key); /* borrowed */
if (kv == NULL) if (kv == NULL) {
PyErr_Clear();
return NULL; return NULL;
}
return PyDict_GetItem(dp, kv); return PyDict_GetItem(dp, kv);
} }
......
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