From 18fae43b26583f47d83ce5525b2029d7b0c73092 Mon Sep 17 00:00:00 2001 From: "Ralf W. Grosse-Kunstleve" Date: Tue, 18 Oct 2022 17:04:42 -0700 Subject: [PATCH] Add back `case return_value_policy::_return_as_bytes` --- include/pybind11/eigen/matrix.h | 3 +++ include/pybind11/eigen/tensor.h | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/include/pybind11/eigen/matrix.h b/include/pybind11/eigen/matrix.h index 5f5ad3867..c21177f05 100644 --- a/include/pybind11/eigen/matrix.h +++ b/include/pybind11/eigen/matrix.h @@ -360,6 +360,9 @@ private: return eigen_ref_array(*src); case return_value_policy::reference_internal: return eigen_ref_array(*src, parent); + case return_value_policy::_return_as_bytes: + pybind11_fail("return_value_policy::_return_as_bytes does not apply."); + break; default: throw cast_error("unhandled return_value_policy: should not happen!"); }; diff --git a/include/pybind11/eigen/tensor.h b/include/pybind11/eigen/tensor.h index a823c0f39..343e31b80 100644 --- a/include/pybind11/eigen/tensor.h +++ b/include/pybind11/eigen/tensor.h @@ -316,6 +316,10 @@ struct type_caster::ValidType> { writeable = !std::is_const::value; break; + case return_value_policy::_return_as_bytes: + pybind11_fail("return_value_policy::_return_as_bytes does not apply."); + break; + default: pybind11_fail("pybind11 bug in eigen.h, please file a bug report"); }