Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit fd572f6

Browse filesBrowse files
committed
rename pyo3 methods
1 parent 6448bb5 commit fd572f6
Copy full SHA for fd572f6

File tree

Expand file treeCollapse file tree

2 files changed

+4
-4
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+4
-4
lines changed

‎benches/execution.rs

Copy file name to clipboardExpand all lines: benches/execution.rs
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ use std::path::Path;
1111
fn bench_cpython_code(b: &mut Bencher, source: &str) {
1212
pyo3::Python::with_gil(|py| {
1313
b.iter(|| {
14-
let module = pyo3::types::PyModule::from_code_bound(py, source, "", "")
14+
let module = pyo3::types::PyModule::from_code(py, source, "", "")
1515
.expect("Error running source");
1616
black_box(module);
1717
})
@@ -53,7 +53,7 @@ pub fn benchmark_file_parsing(group: &mut BenchmarkGroup<WallTime>, name: &str,
5353
group.bench_function(BenchmarkId::new("cpython", name), |b| {
5454
use pyo3::types::PyAnyMethods;
5555
pyo3::Python::with_gil(|py| {
56-
let builtins = pyo3::types::PyModule::import_bound(py, "builtins")
56+
let builtins = pyo3::types::PyModule::import(py, "builtins")
5757
.expect("Failed to import builtins");
5858
let compile = builtins.getattr("compile").expect("no compile in builtins");
5959
b.iter(|| {

‎benches/microbenchmarks.rs

Copy file name to clipboardExpand all lines: benches/microbenchmarks.rs
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ fn bench_cpython_code(group: &mut BenchmarkGroup<WallTime>, bench: &MicroBenchma
4545

4646
// Grab the exec function in advance so we don't have lookups in the hot code
4747
let builtins =
48-
pyo3::types::PyModule::import_bound(py, "builtins").expect("Failed to import builtins");
48+
pyo3::types::PyModule::import(py, "builtins").expect("Failed to import builtins");
4949
let exec = builtins.getattr("exec").expect("no exec in builtins");
5050

5151
let bench_func = |(globals, locals): &mut (
@@ -99,7 +99,7 @@ fn cpy_compile_code<'a>(
9999
name: &str,
100100
) -> pyo3::PyResult<pyo3::Bound<'a, pyo3::types::PyCode>> {
101101
let builtins =
102-
pyo3::types::PyModule::import_bound(py, "builtins").expect("Failed to import builtins");
102+
pyo3::types::PyModule::import(py, "builtins").expect("Failed to import builtins");
103103
let compile = builtins.getattr("compile").expect("no compile in builtins");
104104
compile.call1((code, name, "exec"))?.extract()
105105
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.