diff --git a/Cargo.toml b/Cargo.toml index 5429ed2c8..f00f8c27f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -53,7 +53,7 @@ rustyline = { workspace = true } [dev-dependencies] criterion = { workspace = true } -pyo3 = { version = "0.26", features = ["auto-initialize"] } +pyo3 = { version = "0.27", features = ["auto-initialize"] } [[bench]] name = "execution" diff --git a/benches/microbenchmarks.rs b/benches/microbenchmarks.rs index f70be5952..98993b415 100644 --- a/benches/microbenchmarks.rs +++ b/benches/microbenchmarks.rs @@ -101,7 +101,10 @@ fn cpy_compile_code<'a>( let builtins = pyo3::types::PyModule::import(py, "builtins").expect("Failed to import builtins"); let compile = builtins.getattr("compile").expect("no compile in builtins"); - compile.call1((code, name, "exec"))?.extract() + Ok(compile + .call1((code, name, "exec"))? + .cast_into() + .expect("compile() should return a code object")) } fn bench_rustpython_code(group: &mut BenchmarkGroup, bench: &MicroBenchmark) {