Skip to content

gh-102304: Fix Py_INCREF() for limited C API 3.9 #105550

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 9, 2023

Conversation

vstinner
Copy link
Member

@vstinner vstinner commented Jun 9, 2023

When Python is built in debug mode (Py_REF_DEBUG macro), Py_INCREF() and Py_DECREF() of the limited C API 3.9 (and older) now call Py_IncRef() and Py_DecRef(), since _Py_IncRef() and _Py_DecRef() were added to Python 3.10.

When Python is built in debug mode (Py_REF_DEBUG macro), Py_INCREF()
and Py_DECREF() of the limited C API 3.9 (and older) now call
Py_IncRef() and Py_DecRef(), since _Py_IncRef() and _Py_DecRef() were
added to Python 3.10.
@vstinner vstinner force-pushed the fix_limited_incref branch from 7a6df6f to c0ade7a Compare June 9, 2023 09:04
@vstinner vstinner enabled auto-merge (squash) June 9, 2023 09:06
@vstinner vstinner merged commit 7ba0fd9 into python:main Jun 9, 2023
@miss-islington
Copy link
Contributor

Thanks @vstinner for the PR 🌮🎉.. I'm working now to backport this PR to: 3.12.
🐍🍒⛏🤖

@bedevere-bot
Copy link

GH-105551 is a backport of this pull request to the 3.12 branch.

@bedevere-bot bedevere-bot removed the needs backport to 3.12 only security fixes label Jun 9, 2023
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jun 9, 2023
When Python is built in debug mode (Py_REF_DEBUG macro), Py_INCREF()
and Py_DECREF() of the limited C API 3.9 (and older) now call
Py_IncRef() and Py_DecRef(), since _Py_IncRef() and _Py_DecRef() were
added to Python 3.10.
(cherry picked from commit 7ba0fd9)

Co-authored-by: Victor Stinner <vstinner@python.org>
@vstinner vstinner deleted the fix_limited_incref branch June 9, 2023 09:34
vstinner added a commit to vstinner/cpython that referenced this pull request Jun 9, 2023
When Python is built in debug mode (Py_REF_DEBUG macro), Py_INCREF()
and Py_DECREF() of the limited C API 3.9 (and older) now call
Py_IncRef() and Py_DecRef(), since _Py_IncRef() and _Py_DecRef() were
added to Python 3.10.

(cherry picked from commit 7ba0fd9)
vstinner added a commit that referenced this pull request Jun 9, 2023
* gh-102304: Fix Py_INCREF() for limited C API 3.9 (#105550)

When Python is built in debug mode (Py_REF_DEBUG macro), Py_INCREF()
and Py_DECREF() of the limited C API 3.9 (and older) now call
Py_IncRef() and Py_DecRef(), since _Py_IncRef() and _Py_DecRef() were
added to Python 3.10.

(cherry picked from commit 7ba0fd9)

* gh-102304: Remove Py_INCREF() doc change (#105552)

Py_INCREF() was made compatible again with Python 3.9 and older in
the limited API of Python debug mode.

(cherry picked from commit 58e4b69)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants