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

Conditionally use Py_REFCNT

This commit is contained in:
Aditya Pillai
2025-03-10 14:19:34 -04:00
committed by Stefan Seefeld
parent cbdf1ce2a1
commit 3e7be69e1e

View File

@@ -222,7 +222,13 @@ namespace
, char const* ref_type)
{
handle<> holder(source);
if (Py_REFCNT(source) <= 1)
if (
#if PY_VERSION_HEX < 0x03090000
source->ob_refcnt
#else
Py_REFCNT(source)
#endif
<= 1)
{
handle<> msg(
#if PY_VERSION_HEX >= 0x3000000