From 9b8ba1cbe6e991abcfeaf46a1e362b9cb703fea9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Klinkovsk=C3=BD?= <1289205+lahwaacz@users.noreply.github.com> Date: Sun, 2 Feb 2025 14:03:54 +0100 Subject: [PATCH] replace PyErr::from_instance with PyErr::from_value 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 https://github.com/PyO3/pyo3/pull/2026 --- crates/pyhq/src/utils/error.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/pyhq/src/utils/error.rs b/crates/pyhq/src/utils/error.rs index 5c1eafb14..9f3681163 100644 --- a/crates/pyhq/src/utils/error.rs +++ b/crates/pyhq/src/utils/error.rs @@ -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)) }) } }