mirror of
https://github.com/RustPython/RustPython.git
synced 2026-06-09 22:49:57 +09:00
os.error is OSError
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user