Skip to content

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

Merged
serhiy-storchaka merged 2 commits into
python:3.15from
miss-islington:backport-36c7440-3.15
Oct 10, 2026
Merged

serhiy-storchaka merged 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

@serhiy-storchaka
serhiy-storchaka merged commit 748fea0 into python:3.15 Oct 10, 2026
51 checks passed
@miss-islington
miss-islington deleted the backport-36c7440-3.15 branch October 10, 2026 11:01
@vstinner

Copy link
Copy Markdown
Member

The change lacks the 2 following commits: I created #159143 to backport them as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

3 participants