diff --git a/rust/src/math_tools.rs b/rust/src/math_tools.rs index c3e5ae4c89..690d9579f7 100644 --- a/rust/src/math_tools.rs +++ b/rust/src/math_tools.rs @@ -64,7 +64,7 @@ pub fn py_chi_square_probability(py: Python, data: &[u8]) -> PyResult { } pub fn init_module(root_module: &Bound<'_, PyModule>) -> PyResult<()> { - let module = PyModule::new_bound(root_module.py(), "math_tools")?; + let module = PyModule::new(root_module.py(), "math_tools")?; module.add_function(wrap_pyfunction!(py_shannon_entropy, &module)?)?; module.add_function(wrap_pyfunction!(py_chi_square_probability, &module)?)?; @@ -72,7 +72,7 @@ pub fn init_module(root_module: &Bound<'_, PyModule>) -> PyResult<()> { root_module .py() - .import_bound("sys")? + .import("sys")? .getattr("modules")? .set_item("unblob._rust.math", module)?; diff --git a/rust/src/sandbox/mod.rs b/rust/src/sandbox/mod.rs index 439d6752c6..15877382e2 100644 --- a/rust/src/sandbox/mod.rs +++ b/rust/src/sandbox/mod.rs @@ -107,18 +107,18 @@ impl PyAccessFS { } pub fn init_module(root_module: &Bound<'_, PyModule>) -> PyResult<()> { - let module = PyModule::new_bound(root_module.py(), "sandbox")?; + let module = PyModule::new(root_module.py(), "sandbox")?; module.add_function(wrap_pyfunction!(py_restrict_access, &module)?)?; module.add_class::()?; module.add( "SandboxError", - root_module.py().get_type_bound::(), + root_module.py().get_type::(), )?; root_module.add_submodule(&module)?; root_module .py() - .import_bound("sys")? + .import("sys")? .getattr("modules")? .set_item("unblob._rust.sandbox", module)?;