Skip to content

Commit 98336ea

Browse files
committed
chore: Upgrade Pyo3 to 0.12.
1 parent 68e0a29 commit 98336ea

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

python/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
### Changed
66

77
- Links to remote stylesheets are deduplicated now.
8+
- Upgrade `Pyo3` to `0.12`.
89

910
### Performance
1011

python/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ default-features = false
2121
[dependencies]
2222
url = "2"
2323
rayon = "1"
24-
pyo3 = { version = "^0.11", features = ["extension-module"] }
24+
pyo3 = { version = "^0.12", features = ["extension-module"] }
2525
pyo3-built = "0.4"
2626

2727
[profile.release]

python/src/lib.rs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,16 +27,18 @@ use std::borrow::Cow;
2727

2828
const INLINE_ERROR_DOCSTRING: &str = "An error that can occur during CSS inlining";
2929

30-
create_exception!(css_inline, InlineError, exceptions::ValueError);
30+
create_exception!(css_inline, InlineError, exceptions::PyValueError);
3131

3232
struct InlineErrorWrapper(rust_inline::InlineError);
3333

3434
impl From<InlineErrorWrapper> for PyErr {
3535
fn from(error: InlineErrorWrapper) -> Self {
3636
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+
}
4042
}
4143
}
4244
}
@@ -45,7 +47,7 @@ struct UrlError(url::ParseError);
4547

4648
impl From<UrlError> for PyErr {
4749
fn from(error: UrlError) -> Self {
48-
exceptions::ValueError::py_err(error.0.to_string())
50+
exceptions::PyValueError::new_err(error.0.to_string())
4951
}
5052
}
5153

0 commit comments

Comments
 (0)