Commit 5b997d65 authored by Ronan Lamy's avatar Ronan Lamy
Browse files

Rename to PyDict_GetItemWithError (no leading underscore)

(grafted from 6e344fc026c3)

--HG--
branch : release-pypy3.6-v7.x
parent c162c307e6dd
......@@ -81,8 +81,11 @@ def PyDict_GetItem(space, w_dict, w_key):
return w_dict.getitem(w_key)
@cpython_api([PyObject, PyObject], PyObject, result_borrowed=True)
def _PyDict_GetItemWithError(space, w_dict, w_key):
# Like PyDict_GetItem(), but doesn't swallow the error
def PyDict_GetItemWithError(space, w_dict, w_key):
"""Variant of PyDict_GetItem() that does not suppress
exceptions. Return NULL with an exception set if an exception
occurred. Return NULL without an exception set if the key
wasn't present."""
if not isinstance(w_dict, W_DictMultiObject):
PyErr_BadInternalCall(space)
return w_dict.getitem(w_key)
......
......@@ -243,14 +243,6 @@ def PyDescr_IsData(space, descr):
def PyWrapper_New(space, w_d, w_self):
raise NotImplementedError
@cpython_api([PyObject, PyObject], PyObject)
def PyDict_GetItemWithError(space, p, key):
"""Variant of PyDict_GetItem() that does not suppress
exceptions. Return NULL with an exception set if an exception
occurred. Return NULL without an exception set if the key
wasn't present."""
raise NotImplementedError
@cpython_api([PyObject, PyObject, rffi.INT_real], rffi.INT_real, error=-1)
def PyDict_MergeFromSeq2(space, a, seq2, override):
"""Update or merge into dictionary a, from the key-value pairs in seq2.
......
......@@ -183,7 +183,7 @@ class AppTestDictObject(AppTestCpythonExtensionBase):
if (!PyArg_ParseTuple(args, "OO", &d, &key)) {
return NULL;
}
result = _PyDict_GetItemWithError(d, key);
result = PyDict_GetItemWithError(d, key);
if (result == NULL && !PyErr_Occurred())
Py_RETURN_NONE;
Py_XINCREF(result);
......
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