Skip to content

Commit 3e7be69

Browse files
pilleyestefanseefeld
authored andcommitted
Conditionally use Py_REFCNT
1 parent cbdf1ce commit 3e7be69

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

Diff for: src/converter/from_python.cpp

+7-1
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,13 @@ namespace
222222
, char const* ref_type)
223223
{
224224
handle<> holder(source);
225-
if (Py_REFCNT(source) <= 1)
225+
if (
226+
#if PY_VERSION_HEX < 0x03090000
227+
source->ob_refcnt
228+
#else
229+
Py_REFCNT(source)
230+
#endif
231+
<= 1)
226232
{
227233
handle<> msg(
228234
#if PY_VERSION_HEX >= 0x3000000

0 commit comments

Comments
 (0)