mirror of
https://github.com/python/cpython.git
synced 2025-11-01 18:51:43 +00:00
gh-108511: Add C API functions which do not silently ignore errors (GH-109025)
Add the following functions: * PyObject_HasAttrWithError() * PyObject_HasAttrStringWithError() * PyMapping_HasKeyWithError() * PyMapping_HasKeyStringWithError()
This commit is contained in:
parent
e57ecf6bbc
commit
add16f1a5e
28 changed files with 330 additions and 111 deletions
|
|
@ -41,7 +41,7 @@ _get_current_interp(void)
|
|||
static PyObject *
|
||||
add_new_exception(PyObject *mod, const char *name, PyObject *base)
|
||||
{
|
||||
assert(!PyObject_HasAttrString(mod, name));
|
||||
assert(!PyObject_HasAttrStringWithError(mod, name));
|
||||
PyObject *exctype = PyErr_NewException(name, base, NULL);
|
||||
if (exctype == NULL) {
|
||||
return NULL;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue