From c71c78c1a077af0ce698e2519076ee78a657be32 Mon Sep 17 00:00:00 2001 From: "Jeong, YunWon" <69878+youknowone@users.noreply.github.com> Date: Wed, 10 Dec 2025 10:29:20 +0900 Subject: [PATCH] Upgrade pyo3 (#6389) --- Cargo.toml | 2 +- benches/microbenchmarks.rs | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) 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) {