From d168e60ca499f4b9746551c467c65f8657c574d9 Mon Sep 17 00:00:00 2001 From: Icxolu <10486322+Icxolu@users.noreply.github.com> Date: Sat, 26 Oct 2024 21:31:09 +0200 Subject: [PATCH] switch `PyErrArguments` blanket impl to `IntoPyObject` (#4660) --- 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()), + } } }