Skip to content

Commit

Permalink
gh-91321: Fix _PyObject_EXTRA_INIT for C++ (#92396)
Browse files Browse the repository at this point in the history
In C++, the _PyObject_EXTRA_INIT macro now uses nullptr, rather than
0, to initialize the _ob_next and _ob_prev members of the PyObject
structure.

Fix test_cppext failure when Python is built with
./configure --with-trace-refs.
  • Loading branch information
vstinner authored May 6, 2022
1 parent 5fbaf80 commit c33d67c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Include/object.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ whose size is determined when the object is allocated.
PyObject *_ob_next; \
PyObject *_ob_prev;

#define _PyObject_EXTRA_INIT 0, 0,
#define _PyObject_EXTRA_INIT _Py_NULL, _Py_NULL,

#else
# define _PyObject_HEAD_EXTRA
Expand Down

0 comments on commit c33d67c

Please sign in to comment.