mirror of
https://github.com/python/cpython.git
synced 2025-08-22 17:55:18 +00:00
gh-108308: Remove _PyDict_GetItemStringWithError() function (#108426)
Remove the internal _PyDict_GetItemStringWithError() function. It can now be replaced with the new public PyDict_ContainsString() and PyDict_GetItemStringRef() functions. getargs.c now now uses a strong reference for current_arg. find_keyword() returns a strong reference.
This commit is contained in:
parent
ea871c9b0f
commit
52c6a6e48a
5 changed files with 36 additions and 44 deletions
|
@ -87,7 +87,12 @@ _PySys_GetObject(PyInterpreterState *interp, const char *name)
|
|||
if (sysdict == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
return _PyDict_GetItemStringWithError(sysdict, name);
|
||||
PyObject *value;
|
||||
if (PyDict_GetItemStringRef(sysdict, name, &value) != 1) {
|
||||
return NULL;
|
||||
}
|
||||
Py_DECREF(value); // return a borrowed reference
|
||||
return value;
|
||||
}
|
||||
|
||||
PyObject *
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue