Skip to content

Commit

Permalink
Fix deprecated PyO3 functions
Browse files Browse the repository at this point in the history
  • Loading branch information
mrexodia committed Oct 13, 2024
1 parent c6ca1f1 commit d7d49b0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -199,11 +199,11 @@ impl From<ExceptionCode> for ExceptionCodePy {
#[allow(non_snake_case)]
fn raise_MemoryException(message: String, e: MemError) -> PyErr {
Python::with_gil(|py| {
let icicle = py.import("icicle").unwrap();
let icicle = py.import_bound("icicle").unwrap();
let exception = icicle.getattr("MemoryException").unwrap();
let args = (message, MemoryExceptionCode::from(e));
let inst = exception.call1(args).unwrap();
PyErr::from_value(inst)
PyErr::from_value_bound(inst)
})
}

Expand Down Expand Up @@ -508,7 +508,7 @@ fn architectures() -> PyResult<Vec<&'static str>> {
/// the `lib.name` setting in the `Cargo.toml`, else Python will not be able to
/// import the module.
#[pymodule]
fn icicle(_: Python<'_>, m: &PyModule) -> PyResult<()> {
fn icicle(m: &Bound<'_, PyModule>) -> PyResult<()> {
m.add_function(wrap_pyfunction!(architectures, m)?)?;
m.add_class::<Icicle>()?;
m.add_class::<MemoryProtection>()?;
Expand Down

0 comments on commit d7d49b0

Please sign in to comment.