From cbdf1ce2a1f68abbc64729e9026e312fb858e3c6 Mon Sep 17 00:00:00 2001 From: Aditya Pillai Date: Mon, 10 Mar 2025 14:03:41 -0400 Subject: [PATCH] Use Py_REFCNT instead of ->ob_refcnt Py_REFCNT was stabilized in 3.9, uses this official API instead of the `ob_refcnt` field that doesn't exist in the free-threaded build of 3.13. --- src/converter/from_python.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/converter/from_python.cpp b/src/converter/from_python.cpp index 9678be1c..589d99ef 100644 --- a/src/converter/from_python.cpp +++ b/src/converter/from_python.cpp @@ -222,7 +222,7 @@ namespace , char const* ref_type) { handle<> holder(source); - if (source->ob_refcnt <= 1) + if (Py_REFCNT(source) <= 1) { handle<> msg( #if PY_VERSION_HEX >= 0x3000000