Skip to content

Commit

Permalink
minor fixes for v3.13
Browse files Browse the repository at this point in the history
  • Loading branch information
wjakob committed Sep 8, 2024
1 parent e3812ea commit b2bed68
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
3 changes: 1 addition & 2 deletions src/nb_type.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion tests/test_functions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
3 changes: 1 addition & 2 deletions tests/test_stl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,7 @@ int funcwrapper_tp_traverse(PyObject *self, visitproc visit, void *arg) {
Py_VISIT(f.ptr());

return 0;
};

}

int FuncWrapper::alive = 0;

Expand Down

0 comments on commit b2bed68

Please sign in to comment.