Skip to content

Commit c21f2bd

Browse files
miss-islingtonnascheme
andauthoredJun 5, 2022
gh-93442: Add test for _Py_CAST(nullptr). (gh-93505) (gh-93509)
(cherry picked from commit 713eb18) Co-authored-by: Neil Schemenauer <nas-github@arctrix.com> Co-authored-by: Neil Schemenauer <nas-github@arctrix.com>
1 parent d97e2c5 commit c21f2bd

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed
 

‎Lib/test/_testcppext.cpp

+3
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,9 @@ test_api_casts(PyObject *Py_UNUSED(module), PyObject *Py_UNUSED(args))
7777
// gh-93442: Pass 0 as NULL for PyObject*
7878
Py_XINCREF(0);
7979
Py_XDECREF(0);
80+
// ensure that nullptr works too
81+
Py_XINCREF(nullptr);
82+
Py_XDECREF(nullptr);
8083

8184
Py_DECREF(obj);
8285
Py_RETURN_NONE;

0 commit comments

Comments
 (0)
Please sign in to comment.