os.error is OSError

This commit is contained in:
Noah
2021-04-09 13:19:16 -05:00
parent b4827a8d22
commit 0fcaaa62d9

View File

@@ -475,13 +475,6 @@ mod _os {
Ok(vm.ctx.new_int(written as u64))
}
#[pyfunction]
fn error(message: OptionalArg<PyStrRef>, vm: &VirtualMachine) -> PyResult {
let msg = message.map_or("".to_owned(), |msg| msg.borrow_value().to_owned());
Err(vm.new_os_error(msg))
}
#[pyfunction]
fn fsync(fd: i64, vm: &VirtualMachine) -> PyResult<()> {
let file = rust_file(fd);
@@ -1414,6 +1407,7 @@ pub fn make_module(vm: &VirtualMachine) -> PyObjectRef {
"supports_fd" => supports_fd.into_object(),
"supports_dir_fd" => supports_dir_fd.into_object(),
"supports_follow_symlinks" => supports_follow_symlinks.into_object(),
"error" => vm.ctx.exceptions.os_error.clone(),
});
module