string wrap

This commit is contained in:
Michael Carlstrom 2024-12-19 13:33:20 -08:00
parent 8b241f1727
commit f205bb4840

View File

@ -1382,7 +1382,7 @@ obj_attr_accessor object_api<D>::attr_with_type_hint(handle key) const {
object ann = annotations(); object ann = annotations();
object reinterpreted_key = reinterpret_borrow<object>(key); object reinterpreted_key = reinterpret_borrow<object>(key);
if (ann.contains(reinterpreted_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."); + "\"] was set already.");
} }
ann[key] = make_caster<T>::name.text; ann[key] = make_caster<T>::name.text;