(file: &PyObject, vm: &VirtualMachine)
| 389 | } |
| 390 | |
| 391 | fn check_seekable(file: &PyObject, vm: &VirtualMachine) -> PyResult<()> { |
| 392 | if vm.call_method(file, "seekable", ())?.try_to_bool(vm)? { |
| 393 | Ok(()) |
| 394 | } else { |
| 395 | Err(new_unsupported_operation( |
| 396 | vm, |
| 397 | "File or stream is not seekable".to_owned(), |
| 398 | )) |
| 399 | } |
| 400 | } |
| 401 | |
| 402 | fn check_decoded(decoded: PyObjectRef, vm: &VirtualMachine) -> PyResult<PyStrRef> { |
| 403 | decoded.downcast().map_err(|obj| { |
no test coverage detected