Skip to content

Commit

Permalink
pythongh-93442: Add test for _Py_CAST(nullptr). (pythongh-93505)
Browse files Browse the repository at this point in the history
  • Loading branch information
nascheme authored Jun 5, 2022
1 parent 8bcc3fa commit 713eb18
Showing 1 changed file with 3 additions and 0 deletions.
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

0 comments on commit 713eb18

Please sign in to comment.