Skip to content

Commit

Permalink
switch PyErrArguments blanket impl to IntoPyObject (#4660)
Browse files Browse the repository at this point in the history
  • Loading branch information
Icxolu authored Oct 26, 2024
1 parent 81c5bdf commit d168e60
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/err/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,14 @@ pub trait PyErrArguments: Send + Sync {

impl<T> PyErrArguments for T
where
T: IntoPy<PyObject> + 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()),
}
}
}

Expand Down

0 comments on commit d168e60

Please sign in to comment.