(err: PythonObjectDowncastError<'p>)
| 446 | /// Converts `PythonObjectDowncastError` to Python `TypeError`. |
| 447 | impl<'p> std::convert::From<PythonObjectDowncastError<'p>> for PyErr { |
| 448 | fn from(err: PythonObjectDowncastError<'p>) -> PyErr { |
| 449 | let msg = format!( |
| 450 | "Expected type that converts to {} but received {}", |
| 451 | err.expected_type_name, |
| 452 | err.received_type.name(err.py), |
| 453 | ) |
| 454 | .to_py_object(err.py) |
| 455 | .into_object(); |
| 456 | PyErr::new_lazy_init(err.py.get_type::<exc::TypeError>(), Some(msg)) |
| 457 | } |
| 458 | } |
| 459 | |
| 460 | /// Construct PyObject from the result of a Python FFI call that returns a new reference (owned pointer). |
nothing calls this directly
no test coverage detected