From f205bb4840ba8d6df2982f064cd4d4bef0879847 Mon Sep 17 00:00:00 2001 From: Michael Carlstrom Date: Thu, 19 Dec 2024 13:33:20 -0800 Subject: [PATCH] string wrap --- include/pybind11/cast.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/pybind11/cast.h b/include/pybind11/cast.h index 650fcac9e..d4ae36c8f 100644 --- a/include/pybind11/cast.h +++ b/include/pybind11/cast.h @@ -1382,7 +1382,7 @@ obj_attr_accessor object_api::attr_with_type_hint(handle key) const { object ann = annotations(); object reinterpreted_key = reinterpret_borrow(key); if (ann.contains(reinterpreted_key)) { - throw std::runtime_error("__annotations__[\"" + py_str(reinterpreted_key) + throw std::runtime_error("__annotations__[\"" + std::string(py_str(reinterpreted_key)) + "\"] was set already."); } ann[key] = make_caster::name.text;