Skip to content

Commit

Permalink
Fix PY_VERSION_HEX
Browse files Browse the repository at this point in the history
  • Loading branch information
colesbury committed Jan 17, 2025
1 parent 681a04e commit fdafb34
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/nb_type.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ static PyObject **nb_weaklist_ptr(PyObject *self) {
}

static void nb_enable_try_inc_ref(PyObject *obj) noexcept {
#if 0 && defined(Py_GIL_DISABLED) && Py_VERSION_HEX >= 0x031400a4
#if 0 && defined(Py_GIL_DISABLED) && PY_VERSION_HEX >= 0x030E00A5
PyUnstable_EnableTryIncRef(obj);
#elif defined(Py_GIL_DISABLED)
// TODO: Replace with PyUnstable_Object_EnableTryIncRef when available.
Expand All @@ -64,7 +64,7 @@ static void nb_enable_try_inc_ref(PyObject *obj) noexcept {
}

static bool nb_try_inc_ref(PyObject *obj) noexcept {
#if 0 && defined(Py_GIL_DISABLED) && Py_VERSION_HEX >= 0x031400a4
#if 0 && defined(Py_GIL_DISABLED) && PY_VERSION_HEX >= 0x030E00A5
return PyUnstable_TryIncRef(obj);
#elif defined(Py_GIL_DISABLED)
// See https://github.com/python/cpython/blob/d05140f9f77d7dfc753dd1e5ac3a5962aaa03eff/Include/internal/pycore_object.h#L761
Expand Down

0 comments on commit fdafb34

Please sign in to comment.