diff --git a/CHANGELOG.md b/CHANGELOG.md index 92fdfd57..48c65c6e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -44,7 +44,6 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Deprecate `#[name = "..."]` attributes in favor of `#[pyo3(name = "...")]`. [#1567](https://github.com/PyO3/pyo3/pull/1567) - Improve compilation times for projects using PyO3 [#1604](https://github.com/PyO3/pyo3/pull/1604) - ### Removed - Remove deprecated exception names `BaseException` etc. [#1426](https://github.com/PyO3/pyo3/pull/1426) - Remove deprecated redundant methods `Python::is_instance`, `Python::is_subclass`, `Python::release`, `Python::xdecref`, and `Py::from_owned_ptr_or_panic`. [#1426](https://github.com/PyO3/pyo3/pull/1426) diff --git a/src/callback.rs b/src/callback.rs index b5252cab..e162394a 100644 --- a/src/callback.rs +++ b/src/callback.rs @@ -175,15 +175,6 @@ where value.convert(py) } -#[doc(hidden)] -#[inline] -pub fn callback_error() -> T -where - T: PyCallbackOutput, -{ - T::ERR_VALUE -} - /// Use this macro for all internal callback functions which Python will call. /// /// It sets up the GILPool and converts the output into a Python object. It also restores @@ -258,7 +249,7 @@ where { let py_result = match panic_result { Ok(py_result) => py_result, - Err(panic_err) => Err(PanicException::from_panic(panic_err)), + Err(payload) => Err(PanicException::from_panic_payload(payload)), }; py_result.unwrap_or_else(|py_err| { diff --git a/src/panic.rs b/src/panic.rs index 366e886a..d140ac83 100644 --- a/src/panic.rs +++ b/src/panic.rs @@ -16,10 +16,10 @@ pyo3_exception!( impl PanicException { // Try to format the error in the same way panic does - pub(crate) fn from_panic(e: Box) -> PyErr { - if let Some(string) = e.downcast_ref::() { + pub(crate) fn from_panic_payload(payload: Box) -> PyErr { + if let Some(string) = payload.downcast_ref::() { Self::new_err((string.clone(),)) - } else if let Some(s) = e.downcast_ref::<&str>() { + } else if let Some(s) = payload.downcast_ref::<&str>() { Self::new_err((s.to_string(),)) } else { Self::new_err(("panic from Rust code",))