diff --git a/vm/src/stdlib/io.rs b/vm/src/stdlib/io.rs
index 7f13ce168..c33c3c882 100644
--- a/vm/src/stdlib/io.rs
+++ b/vm/src/stdlib/io.rs
@@ -259,7 +259,7 @@ mod _io {
}
fn check_readable(file: &PyObjectRef, vm: &VirtualMachine) -> PyResult<()> {
- if pybool::boolval(vm, call_method(vm, file, "readable", ())?)? {
+ if pybool::boolval(vm, vm.call_method(file, "readable", ())?)? {
Ok(())
} else {
Err(new_unsupported_operation(
@@ -270,7 +270,7 @@ mod _io {
}
fn check_writable(file: &PyObjectRef, vm: &VirtualMachine) -> PyResult<()> {
- if pybool::boolval(vm, call_method(vm, file, "writable", ())?)? {
+ if pybool::boolval(vm, vm.call_method(file, "writable", ())?)? {
Ok(())
} else {
Err(new_unsupported_operation(
@@ -281,7 +281,7 @@ mod _io {
}
fn check_seekable(file: &PyObjectRef, vm: &VirtualMachine) -> PyResult<()> {
- if pybool::boolval(vm, call_method(vm, file, "seekable", ())?)? {
+ if pybool::boolval(vm, vm.call_method(file, "seekable", ())?)? {
Ok(())
} else {
Err(new_unsupported_operation(
@@ -308,7 +308,7 @@ mod _io {
}
#[pymethod]
fn tell(zelf: PyObjectRef, vm: &VirtualMachine) -> PyResult {
- call_method(vm, &zelf, "seek", (0, 1))
+ vm.call_method(&zelf, "seek", (0, 1))
}
#[pymethod]
fn truncate(zelf: PyObjectRef, _pos: OptionalArg, vm: &VirtualMachine) -> PyResult {
@@ -328,7 +328,7 @@ mod _io {
#[pyslot]
fn tp_del(instance: &PyObjectRef, vm: &VirtualMachine) -> PyResult<()> {
- let _ = call_method(vm, instance, "close", ());
+ let _ = vm.call_method(instance, "close", ());
Ok(())
}
@@ -339,7 +339,7 @@ mod _io {
#[pymethod(magic)]
fn exit(instance: PyObjectRef, _args: FuncArgs, vm: &VirtualMachine) -> PyResult<()> {
- call_method(vm, &instance, "close", ())?;
+ vm.call_method(&instance, "close", ())?;
Ok(())
}
@@ -428,7 +428,7 @@ mod _io {
) -> PyResult<()> {
check_closed(&instance, vm)?;
for line in lines.iter(vm)? {
- call_method(vm, &instance, "write", (line?,))?;
+ vm.call_method(&instance, "write", (line?,))?;
}
Ok(())
}
@@ -461,7 +461,7 @@ mod _io {
}
#[pyslot]
fn tp_iternext(instance: &PyObjectRef, vm: &VirtualMachine) -> PyResult {
- let line = call_method(vm, &instance, "readline", ())?;
+ let line = vm.call_method(&instance, "readline", ())?;
if !pybool::boolval(vm, line.clone())? {
Err(vm.new_stop_iteration())
} else {
@@ -476,7 +476,7 @@ mod _io {
pub(super) fn iobase_close(file: &PyObjectRef, vm: &VirtualMachine) -> PyResult<()> {
if !file_closed(file, vm)? {
- let res = call_method(vm, file, "flush", ());
+ let res = vm.call_method(file, "flush", ());
vm.set_attr(file, "__closed", vm.ctx.new_bool(true))?;
res?;
}
@@ -496,7 +496,7 @@ mod _io {
let b = PyByteArray::from(vec![0; size]).into_ref(vm);
let n =