mirror of
https://github.com/python/cpython.git
synced 2025-08-22 17:55:18 +00:00
gh-106572: Convert PyObject_DelAttr() to a function (#106611)
* Convert PyObject_DelAttr() and PyObject_DelAttrString() macros to functions. * Add PyObject_DelAttr() and PyObject_DelAttrString() functions to the stable ABI. * Replace PyObject_SetAttr(obj, name, NULL) with PyObject_DelAttr(obj, name).
This commit is contained in:
parent
e6379f72cb
commit
1f2921b72c
12 changed files with 33 additions and 8 deletions
|
@ -1567,8 +1567,9 @@ static PyObject *
|
|||
builtin_delattr_impl(PyObject *module, PyObject *obj, PyObject *name)
|
||||
/*[clinic end generated code: output=85134bc58dff79fa input=164865623abe7216]*/
|
||||
{
|
||||
if (PyObject_SetAttr(obj, name, (PyObject *)NULL) != 0)
|
||||
if (PyObject_DelAttr(obj, name) < 0) {
|
||||
return NULL;
|
||||
}
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue