From 9a36b5078989a7c07a5e880aea3c6da205585ee3 Mon Sep 17 00:00:00 2001 From: David Hewitt Date: Mon, 19 Feb 2024 22:15:36 +0000 Subject: [PATCH] update `py.import` -> `py.import_bound` in benches (#3868) --- pyo3-benches/benches/bench_intern.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyo3-benches/benches/bench_intern.rs b/pyo3-benches/benches/bench_intern.rs index d8dd1b8f..806c4e95 100644 --- a/pyo3-benches/benches/bench_intern.rs +++ b/pyo3-benches/benches/bench_intern.rs @@ -6,7 +6,7 @@ use pyo3::intern; fn getattr_direct(b: &mut Bencher<'_>) { Python::with_gil(|py| { - let sys = py.import("sys").unwrap(); + let sys = py.import_bound("sys").unwrap(); b.iter(|| sys.getattr("version").unwrap()); }); @@ -14,7 +14,7 @@ fn getattr_direct(b: &mut Bencher<'_>) { fn getattr_intern(b: &mut Bencher<'_>) { Python::with_gil(|py| { - let sys = py.import("sys").unwrap(); + let sys = py.import_bound("sys").unwrap(); b.iter(|| sys.getattr(intern!(py, "version")).unwrap()); });