Skip to content

Commit b75ba3e

Browse files
committed
Fix ci errors
1 parent 466f24c commit b75ba3e

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

vm/src/import.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ pub fn init_importlib(vm: &VirtualMachine, initialize_parameter: InitParameter)
4545
path_hooks.insert(0, zipimporter);
4646
Ok(())
4747
})();
48-
if let Err(_) = zipimport_res {
48+
if zipimport_res.is_err() {
4949
eprintln!("couldn't init zipimport")
5050
}
5151
}

vm/src/stdlib/io.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -620,14 +620,14 @@ mod fileio {
620620
vm,
621621
)?
622622
};
623-
(name.clone().into_object(), fd)
623+
(name.into_object(), fd)
624624
}
625625
Either::B(fno) => (vm.new_int(fno), fno),
626626
};
627627

628628
vm.set_attr(&file_io, "name", name)?;
629629
vm.set_attr(&file_io, "__fileno", vm.new_int(file_no))?;
630-
vm.set_attr(&file_io, "__closefd", vm.new_bool(args.closefd))?;
630+
vm.set_attr(&file_io, "closefd", vm.new_bool(args.closefd))?;
631631
vm.set_attr(&file_io, "__closed", vm.new_bool(false))?;
632632
Ok(vm.get_none())
633633
}
@@ -723,7 +723,7 @@ mod fileio {
723723
}
724724

725725
fn file_io_close(instance: PyObjectRef, vm: &VirtualMachine) -> PyResult<()> {
726-
let closefd = objbool::boolval(vm, vm.get_attribute(instance.clone(), "__closefd")?)?;
726+
let closefd = objbool::boolval(vm, vm.get_attribute(instance.clone(), "closefd")?)?;
727727
if closefd {
728728
let raw_handle =
729729
i64::try_from_object(vm, vm.get_attribute(instance.clone(), "__fileno")?)?;

0 commit comments

Comments
 (0)