Skip to content

Commit

Permalink
replace PyErr::from_instance with PyErr::from_value
Browse files Browse the repository at this point in the history
Since [pyo3 0.16.0](https://pyo3.rs/main/changelog):

Rename some methods on PyErr (the old names are just marked deprecated for now):
- pytype -> get_type
- pvalue -> value (and deprecate equivalent instance)
- ptraceback -> traceback
- from_instance -> from_value
- into_instance -> into_value

PyO3/pyo3#2026
  • Loading branch information
lahwaacz committed Feb 2, 2025
1 parent a53dc62 commit 9b8ba1c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion crates/pyhq/src/utils/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ pub(crate) trait ToPyError {
impl ToPyError for HqError {
fn to_py(self) -> PyErr {
Python::with_gil(|py| {
PyErr::from_instance(PyException::new_err(format!("{self:?}")).instance(py))
PyErr::from_value(PyException::new_err(format!("{self:?}")).value(py))
})
}
}
Expand Down

0 comments on commit 9b8ba1c

Please sign in to comment.