From e6ee3d120bf6043c6f755e909a68eb756ac101e5 Mon Sep 17 00:00:00 2001 From: Dean Moldovan Date: Sun, 15 Oct 2023 12:37:56 +0200 Subject: [PATCH] tmp --- cppcore/include/detail/algorithm.hpp | 2 +- cppmodule/CMakeLists.txt | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/cppcore/include/detail/algorithm.hpp b/cppcore/include/detail/algorithm.hpp index 4243d672..4f8cb8ff 100644 --- a/cppcore/include/detail/algorithm.hpp +++ b/cppcore/include/detail/algorithm.hpp @@ -26,7 +26,7 @@ class Sliced { Iterator(InnerIt last) : it(last) {} InnerIt begin() const { return it; } - InnerIt end() const { return std::min(it + step, last); } + InnerIt end() const { return it + std::min(step, last - it); } reference operator*() { return *this; } pointer operator->() { return this; } diff --git a/cppmodule/CMakeLists.txt b/cppmodule/CMakeLists.txt index e42edc32..c05980b2 100644 --- a/cppmodule/CMakeLists.txt +++ b/cppmodule/CMakeLists.txt @@ -38,3 +38,5 @@ endif() add_custom_target(pytest COMMAND ${PYTHON_EXECUTABLE} -m pytest DEPENDS _pybinding WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}) + +target_compile_definitions(_pybinding PRIVATE PYBIND11_NO_ASSERT_GIL_HELD_INCREF_DECREF)