From 3adfb7dd7aacff0a7eff18152311bf455bfbf66d Mon Sep 17 00:00:00 2001 From: Icxolu <10486322+Icxolu@users.noreply.github.com> Date: Sat, 26 Oct 2024 20:15:01 +0200 Subject: [PATCH] switch `PyErrArguments` blanket impl to `IntoPyObject` --- src/err/mod.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/err/mod.rs b/src/err/mod.rs index 14c368938f1..d65eac171f6 100644 --- a/src/err/mod.rs +++ b/src/err/mod.rs @@ -101,10 +101,14 @@ pub trait PyErrArguments: Send + Sync { impl PyErrArguments for T where - T: IntoPy + Send + Sync, + T: for<'py> IntoPyObject<'py> + Send + Sync, { fn arguments(self, py: Python<'_>) -> PyObject { - self.into_py(py) + // FIXME: `arguments` should become fallible + match self.into_pyobject(py) { + Ok(obj) => obj.into_any().unbind(), + Err(e) => panic!("Converting PyErr arguments failed: {}", e.into()), + } } }