Skip to content

[3.15] gh-121617: Fix Py_CLEAR() in C++: replace NULL with _Py_NULL (GH-157067) - #157186

Open
miss-islington wants to merge 2 commits into
python:3.15from
miss-islington:backport-36c7440-3.15
Open

[3.15] gh-121617: Fix Py_CLEAR() in C++: replace NULL with _Py_NULL (GH-157067)#157186
miss-islington wants to merge 2 commits into
python:3.15from
miss-islington:backport-36c7440-3.15

Conversation

@miss-islington

@miss-islington miss-islington commented Sep 8, 2026

Copy link
Copy Markdown
Contributor
  • Enhance Py_CLEAR() test in test_cext and test_cppext.
    Check that Py_CLEAR(obj) sets obj to NULL.
  • Add also tests on Py_SETREF() and Py_BEGIN_CRITICAL_SECTION().
    (cherry picked from commit 36c7440)

Co-authored-by: Victor Stinner vstinner@python.org

…ythonGH-157067)

* Enhance Py_CLEAR() test in test_cext and test_cppext.
  Check that Py_CLEAR(obj) sets obj to NULL.
* Add also tests on Py_SETREF() and Py_BEGIN_CRITICAL_SECTION().
(cherry picked from commit 36c7440)

Co-authored-by: Victor Stinner <vstinner@python.org>

@vstinner vstinner left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

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.

2 participants