mirror of
https://github.com/python/cpython.git
synced 2025-11-25 04:34:37 +00:00
gh-89653: PEP 670: Convert PyCell macros to functions (#92653)
Convert the following macros to static inline functions: * PyCell_GET() * PyCell_SET() Limited C API version 3.12 no longer casts arguments. Fix also usage of PyCell_SET(): only delete the old value after setting the new value.
This commit is contained in:
parent
da5727a120
commit
897f14d38d
3 changed files with 25 additions and 11 deletions
|
|
@ -1086,9 +1086,9 @@ _PyFrame_LocalsToFast(_PyInterpreterFrame *frame, int clear)
|
|||
if (cell != NULL) {
|
||||
oldvalue = PyCell_GET(cell);
|
||||
if (value != oldvalue) {
|
||||
Py_XDECREF(oldvalue);
|
||||
Py_XINCREF(value);
|
||||
PyCell_SET(cell, value);
|
||||
Py_XDECREF(oldvalue);
|
||||
}
|
||||
}
|
||||
else if (value != oldvalue) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue