From 3b2f0ebcc31b229a9e848c11be5d402f0c416315 Mon Sep 17 00:00:00 2001 From: "Jonathan M. Waldrop" Date: Mon, 9 Jun 2025 14:53:42 -0500 Subject: [PATCH 1/2] In PythonWrapper::unwrap, recast if buffer value type inconsistent with clean_type --- include/pluginplay/python/python_wrapper.hpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/pluginplay/python/python_wrapper.hpp b/include/pluginplay/python/python_wrapper.hpp index 5cc0d0061..11014a72e 100644 --- a/include/pluginplay/python/python_wrapper.hpp +++ b/include/pluginplay/python/python_wrapper.hpp @@ -18,6 +18,7 @@ #include #include #ifdef BUILD_PYBIND11 +#include #include #include #include @@ -305,7 +306,7 @@ T PythonWrapper::unwrap() { } // User wants the converted C++ value by reference or const reference else { - if(m_buffer_.empty()) { + if(m_buffer_.empty() || m_buffer_.type() != typeid(clean_type)) { auto cxx_value = py_value.cast(); m_buffer_ = std::move(cxx_value); } From 201d6d31e2330cf88e749a36a19e9a337265db5f Mon Sep 17 00:00:00 2001 From: "Jonathan M. Waldrop" Date: Mon, 9 Jun 2025 14:55:00 -0500 Subject: [PATCH 2/2] remove extra header include --- include/pluginplay/python/python_wrapper.hpp | 1 - 1 file changed, 1 deletion(-) diff --git a/include/pluginplay/python/python_wrapper.hpp b/include/pluginplay/python/python_wrapper.hpp index 11014a72e..26e2291c5 100644 --- a/include/pluginplay/python/python_wrapper.hpp +++ b/include/pluginplay/python/python_wrapper.hpp @@ -18,7 +18,6 @@ #include #include #ifdef BUILD_PYBIND11 -#include #include #include #include