Skip to content

Commit

Permalink
build: bump py-build-cmake
Browse files Browse the repository at this point in the history
  • Loading branch information
nickelpro committed Jan 1, 2025
1 parent 443f905 commit f5ebc67
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 11 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ endif()
add_subdirectory(src)

if(DEFINED PY_BUILD_CMAKE_VERSION)
set(NANOROUTE_PLATLIB ${PY_BUILD_CMAKE_PACKAGE_NAME}-${PY_BUILD_CMAKE_PACKAGE_VERSION}.data/platlib)
set(NANOROUTE_PLATLIB ${PY_BUILD_CMAKE_PROJECT_NAME}-${PY_BUILD_CMAKE_PROJECT_VERSION}.data/platlib)
else()
set(NANOROUTE_PLATLIB platlib)
endif()
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ urls = { "Documentation" = "https://nanoroute.dev" }
dependencies = []

[build-system]
requires = ["py-build-cmake~=0.3.3"]
requires = ["py-build-cmake~=0.3.4"]
build-backend = "py_build_cmake.build"

[tool.py-build-cmake.module]
Expand Down
17 changes: 8 additions & 9 deletions src/PyRouter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -447,15 +447,14 @@ int PyRouter::init(PyRouter* self, PyObject* /*args*/, PyObject* /*kwargs*/) {
int PyRouter::traverse(PyRouter* self, visitproc visit, void* arg) {
Py_VISIT(Py_TYPE(self));
Py_VISIT(self->mod_);
auto result {self->httprouter_.traverse(
[&](PyObject* app) {
Py_VISIT(app);
return 0;
},
[](int v) { return v; })};
if(result)
return *result;
return 0;
return self->httprouter_
.traverse(
[&](PyObject* app) {
Py_VISIT(app);
return 0;
},
[](int v) { return v; })
.value_or(0);
}

int PyRouter::clear(PyRouter* self) {
Expand Down

0 comments on commit f5ebc67

Please sign in to comment.