(file: &PyObject, vm: &VirtualMachine)
| 367 | } |
| 368 | |
| 369 | fn check_readable(file: &PyObject, vm: &VirtualMachine) -> PyResult<()> { |
| 370 | if vm.call_method(file, "readable", ())?.try_to_bool(vm)? { |
| 371 | Ok(()) |
| 372 | } else { |
| 373 | Err(new_unsupported_operation( |
| 374 | vm, |
| 375 | "File or stream is not readable".to_owned(), |
| 376 | )) |
| 377 | } |
| 378 | } |
| 379 | |
| 380 | fn check_writable(file: &PyObject, vm: &VirtualMachine) -> PyResult<()> { |
| 381 | if vm.call_method(file, "writable", ())?.try_to_bool(vm)? { |
no test coverage detected