From b2bed680933f938cd205e07c466a4405d3dfa4cb Mon Sep 17 00:00:00 2001 From: Wenzel Jakob Date: Wed, 21 Aug 2024 12:42:32 +0900 Subject: [PATCH] minor fixes for v3.13 --- src/nb_type.cpp | 3 +-- tests/test_functions.cpp | 2 +- tests/test_stl.cpp | 3 +-- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/nb_type.cpp b/src/nb_type.cpp index 1fc248c4..783b45e4 100644 --- a/src/nb_type.cpp +++ b/src/nb_type.cpp @@ -1151,9 +1151,8 @@ PyObject *nb_type_new(const type_init_data *t) noexcept { } spec.basicsize = (int) basicsize; - if (!has_getset) { + if (!has_getset) *s++ = { Py_tp_getset, (void *) inst_getset }; - } } if (is_weak_referenceable) { diff --git a/tests/test_functions.cpp b/tests/test_functions.cpp index 69660d31..cfdca460 100644 --- a/tests/test_functions.cpp +++ b/tests/test_functions.cpp @@ -36,7 +36,7 @@ NB_MODULE(test_functions_ext, m) { m.def("test_05", [](int) -> int { return 1; }, "doc_1"); nb::object first_overload = m.attr("test_05"); m.def("test_05", [](float) -> int { return 2; }, "doc_2"); -#if !defined(PYPY_VERSION) +#if !defined(PYPY_VERSION) && !defined(Py_GIL_DISABLED) // Make sure we don't leak the previous member of the overload chain // (pypy's refcounts are bogus and will not help us with this check) if (first_overload.ptr()->ob_refcnt != 1) { diff --git a/tests/test_stl.cpp b/tests/test_stl.cpp index 05f88df6..7d26093a 100644 --- a/tests/test_stl.cpp +++ b/tests/test_stl.cpp @@ -71,8 +71,7 @@ int funcwrapper_tp_traverse(PyObject *self, visitproc visit, void *arg) { Py_VISIT(f.ptr()); return 0; -}; - +} int FuncWrapper::alive = 0;