Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
gh-93442: Add test for _Py_CAST(nullptr). (gh-93505)
(cherry picked from commit 713eb18)

Co-authored-by: Neil Schemenauer <nas-github@arctrix.com>
  • Loading branch information
nascheme authored and miss-islington committed Jun 5, 2022
commit e6ec695ef600194e7a20df8a1841ba65520e8e84
3 changes: 3 additions & 0 deletions Lib/test/_testcppext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,9 @@ test_api_casts(PyObject *Py_UNUSED(module), PyObject *Py_UNUSED(args))
// gh-93442: Pass 0 as NULL for PyObject*
Py_XINCREF(0);
Py_XDECREF(0);
// ensure that nullptr works too
Py_XINCREF(nullptr);
Py_XDECREF(nullptr);

Py_DECREF(obj);
Py_RETURN_NONE;
Expand Down