Skip to content

Commit

Permalink
Use PyModule::new instead of PyModule::new_bound in the example (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
termoshtt authored Dec 10, 2024
1 parent c93b11d commit 22dd214
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions examples/mixed_sub_multiple/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ fn main_mod(m: &Bound<PyModule>) -> PyResult<()> {
#[pymodule]
fn mod_a(parent: &Bound<PyModule>) -> PyResult<()> {
let py = parent.py();
let sub = PyModule::new_bound(py, "mod_a")?;
let sub = PyModule::new(py, "mod_a")?;
sub.add_function(wrap_pyfunction!(greet_a, &sub)?)?;
parent.add_submodule(&sub)?;
Ok(())
Expand All @@ -39,7 +39,7 @@ fn mod_a(parent: &Bound<PyModule>) -> PyResult<()> {
#[pymodule]
fn mod_b(parent: &Bound<PyModule>) -> PyResult<()> {
let py = parent.py();
let sub = PyModule::new_bound(py, "mod_b")?;
let sub = PyModule::new(py, "mod_b")?;
sub.add_function(wrap_pyfunction!(greet_b, &sub)?)?;
parent.add_submodule(&sub)?;
Ok(())
Expand Down

0 comments on commit 22dd214

Please sign in to comment.