File tree Expand file tree Collapse file tree 2 files changed +3
-1
lines changed Expand file tree Collapse file tree 2 files changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -1913,6 +1913,8 @@ pybind11::object PyValue::maybeDownCast() {
1913
1913
" mlirTypeID was expected to be non-null." );
1914
1914
std::optional<pybind11::function> valueCaster =
1915
1915
PyGlobals::get ().lookupValueCaster (mlirTypeID, mlirTypeGetDialect (type));
1916
+ // py::return_value_policy::move means use std::move to move the return value
1917
+ // contents into a new instance that will be owned by Python.
1916
1918
py::object thisObj = py::cast (this , py::return_value_policy::move);
1917
1919
if (!valueCaster)
1918
1920
return thisObj;
Original file line number Diff line number Diff line change @@ -366,7 +366,7 @@ def dont_cast_int_shouldnt_register(v):
366
366
...
367
367
368
368
except RuntimeError as e :
369
- # CHECK: Value caster is already registered: <function testValueCasters.<locals>. cast_int at
369
+ # CHECK: Value caster is already registered: {{.*}} cast_int
370
370
print (e )
371
371
372
372
@register_value_caster (IntegerType .static_typeid , replace = True )
You can’t perform that action at this time.
0 commit comments