@@ -5,18 +5,18 @@ use std::error;
5
5
use std:: fmt;
6
6
7
7
pub trait IntoPyErr {
8
- fn into_pyerr ( self , py : Python , msg : & str ) -> PyErr ;
8
+ fn into_pyerr ( self , msg : & str ) -> PyErr ;
9
9
}
10
10
11
11
pub trait IntoPyResult {
12
12
type ValueType ;
13
- fn into_pyresult ( self , py : Python , message : & str ) -> PyResult < Self :: ValueType > ;
13
+ fn into_pyresult ( self , msg : & str ) -> PyResult < Self :: ValueType > ;
14
14
}
15
15
16
16
impl < T , E : IntoPyErr > IntoPyResult for Result < T , E > {
17
17
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) )
20
20
}
21
21
}
22
22
@@ -49,8 +49,8 @@ impl error::Error for ArrayCastError {
49
49
}
50
50
51
51
impl IntoPyErr for ArrayCastError {
52
- fn into_pyerr ( self , py : Python , msg : & str ) -> PyErr {
52
+ fn into_pyerr ( self , msg : & str ) -> PyErr {
53
53
let msg = format ! ( "rust_numpy::ArrayCastError: {}" , msg) ;
54
- PyErr :: new :: < exc:: TypeError , _ > ( py , msg)
54
+ PyErr :: new :: < exc:: TypeError , _ > ( msg)
55
55
}
56
56
}
0 commit comments