diff options
author | Victor Stinner <vstinner@python.org> | 2022-05-11 21:24:48 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-11 21:24:48 (GMT) |
commit | 897f14d38d1b455668f9f7ce87892f5efcaf8932 (patch) | |
tree | 7b2f8461869d906f38067b583deb24927666638b /Objects/frameobject.c | |
parent | da5727a120e426ffaf68bf3a8016491205bd2f80 (diff) | |
download | cpython-897f14d38d1b455668f9f7ce87892f5efcaf8932.zip cpython-897f14d38d1b455668f9f7ce87892f5efcaf8932.tar.gz cpython-897f14d38d1b455668f9f7ce87892f5efcaf8932.tar.bz2 |
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.
Diffstat (limited to 'Objects/frameobject.c')
-rw-r--r-- | Objects/frameobject.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Objects/frameobject.c b/Objects/frameobject.c index 56c4fce..60f0f2f 100644 --- a/Objects/frameobject.c +++ b/Objects/frameobject.c @@ -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) { |