Skip to content

Commit 481bef2

Browse files
committed
error
1 parent dc27044 commit 481bef2

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/error.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,18 @@ use std::error;
55
use std::fmt;
66

77
pub trait IntoPyErr {
8-
fn into_pyerr(self, py: Python, msg: &str) -> PyErr;
8+
fn into_pyerr(self, msg: &str) -> PyErr;
99
}
1010

1111
pub trait IntoPyResult {
1212
type ValueType;
13-
fn into_pyresult(self, py: Python, message: &str) -> PyResult<Self::ValueType>;
13+
fn into_pyresult(self, msg: &str) -> PyResult<Self::ValueType>;
1414
}
1515

1616
impl<T, E: IntoPyErr> IntoPyResult for Result<T, E> {
1717
type ValueType = T;
18-
fn into_pyresult(self, py: Python, msg: &str) -> PyResult<T> {
19-
self.map_err(|e| e.into_pyerr(py, msg))
18+
fn into_pyresult(self, msg: &str) -> PyResult<T> {
19+
self.map_err(|e| e.into_pyerr(msg))
2020
}
2121
}
2222

@@ -49,8 +49,8 @@ impl error::Error for ArrayCastError {
4949
}
5050

5151
impl IntoPyErr for ArrayCastError {
52-
fn into_pyerr(self, py: Python, msg: &str) -> PyErr {
52+
fn into_pyerr(self, msg: &str) -> PyErr {
5353
let msg = format!("rust_numpy::ArrayCastError: {}", msg);
54-
PyErr::new::<exc::TypeError, _>(py, msg)
54+
PyErr::new::<exc::TypeError, _>(msg)
5555
}
5656
}

0 commit comments

Comments
 (0)