Skip to content

Commit 16b302c

Browse files
committed
fix: implement IsUniqueRefTemp for python<3.14
1 parent fa5b90a commit 16b302c

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

pandas/_libs/internals.pyx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1006,8 +1006,11 @@ cdef class BlockValuesRefs:
10061006

10071007
cdef extern from "Python.h":
10081008
"""
1009+
// python version < 3.14
10091010
#if PY_VERSION_HEX < 0x030E0000
1010-
int __Pyx_PyUnstable_Object_IsUniqueReferencedTemporary(PyObject *ref);
1011+
int __Pyx_PyUnstable_Object_IsUniqueReferencedTemporary(PyObject *ref) {
1012+
return Py_REFCNT(ref) == 1;
1013+
}
10111014
#else
10121015
#define __Pyx_PyUnstable_Object_IsUniqueReferencedTemporary \
10131016
PyUnstable_Object_IsUniqueReferencedTemporary

0 commit comments

Comments
 (0)