From 9f532cfc466fc31450b984246336acc85933cf35 Mon Sep 17 00:00:00 2001 From: Michael Carlstrom Date: Thu, 19 Dec 2024 13:11:29 -0800 Subject: [PATCH] fix str namespace --- 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 6a5ef1543..f556c5ede 100644 --- a/include/pybind11/cast.h +++ b/include/pybind11/cast.h @@ -1379,7 +1379,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__[\"" + std::string(py::str(reinterpreted_key)) + throw std::runtime_error("__annotations__[\"" + std::string(str(reinterpreted_key)) + "\"] was set already."); } ann[key] = make_caster::name.text;