Use as_object in benchmark locals.

This commit is contained in:
jfh
2021-10-19 16:50:27 +03:00
parent de41d4c5ca
commit 6ce591d90c

View File

@@ -4,7 +4,7 @@ use criterion::{
};
use rustpython_compiler::Mode;
use rustpython_vm::{
common::ascii, InitParameter, Interpreter, ItemProtocol, PyResult, PySettings,
common::ascii, InitParameter, Interpreter, ItemProtocol, PyObjectWrap, PyResult, PySettings,
};
use std::path::{Path, PathBuf};
use std::{ffi, fs, io};
@@ -132,6 +132,7 @@ fn bench_rustpy_code(group: &mut BenchmarkGroup<WallTime>, bench: &MicroBenchmar
if let Some(idx) = iterations {
scope
.locals
.as_object()
.set_item(vm.new_pyobj(ascii!("ITERATIONS")), vm.new_pyobj(idx), vm)
.expect("Error adding ITERATIONS local variable");
}