@@ -27,16 +27,18 @@ use std::borrow::Cow;
27
27
28
28
const INLINE_ERROR_DOCSTRING : & str = "An error that can occur during CSS inlining" ;
29
29
30
- create_exception ! ( css_inline, InlineError , exceptions:: ValueError ) ;
30
+ create_exception ! ( css_inline, InlineError , exceptions:: PyValueError ) ;
31
31
32
32
struct InlineErrorWrapper ( rust_inline:: InlineError ) ;
33
33
34
34
impl From < InlineErrorWrapper > for PyErr {
35
35
fn from ( error : InlineErrorWrapper ) -> Self {
36
36
match error. 0 {
37
- rust_inline:: InlineError :: IO ( error) => InlineError :: py_err ( error. to_string ( ) ) ,
38
- rust_inline:: InlineError :: Network ( error) => InlineError :: py_err ( error. to_string ( ) ) ,
39
- rust_inline:: InlineError :: ParseError ( message) => InlineError :: py_err ( message) ,
37
+ rust_inline:: InlineError :: IO ( error) => InlineError :: new_err ( error. to_string ( ) ) ,
38
+ rust_inline:: InlineError :: Network ( error) => InlineError :: new_err ( error. to_string ( ) ) ,
39
+ rust_inline:: InlineError :: ParseError ( message) => {
40
+ InlineError :: new_err ( message. to_string ( ) )
41
+ }
40
42
}
41
43
}
42
44
}
@@ -45,7 +47,7 @@ struct UrlError(url::ParseError);
45
47
46
48
impl From < UrlError > for PyErr {
47
49
fn from ( error : UrlError ) -> Self {
48
- exceptions:: ValueError :: py_err ( error. 0 . to_string ( ) )
50
+ exceptions:: PyValueError :: new_err ( error. 0 . to_string ( ) )
49
51
}
50
52
}
51
53
0 commit comments