2
0
mirror of https://github.com/boostorg/python.git synced 2026-01-19 04:22:16 +00:00

Use Py_REFCNT instead of ob_refcnt on Python 3.9 and above

This commit is contained in:
Aditya Pillai
2025-05-12 15:09:01 -04:00
committed by Stefan Seefeld
parent f604eb8d0f
commit a40bb656ee

View File

@@ -216,7 +216,13 @@ namespace boost { namespace python { namespace detail {
{
for (const_iterator i = proxies.begin(); i != proxies.end(); ++i)
{
if ((*i)->ob_refcnt <= 0)
if (
#if PY_VERSION_HEX < 0x03090000
(*i)->ob_refcnt
#else
Py_REFCNT(*i)
#endif
<= 0)
{
PyErr_SetString(PyExc_RuntimeError,
"Invariant: Proxy vector in an inconsistent state");