MCPcopy Index your code
hub / github.com/RustPython/RustPython / check_closed

Function check_closed

crates/vm/src/stdlib/_io.rs:361–367  ·  view source on GitHub ↗
(file: &PyObject, vm: &VirtualMachine)

Source from the content-addressed store, hash-verified

359 }
360
361 fn check_closed(file: &PyObject, vm: &VirtualMachine) -> PyResult<()> {
362 if file_closed(file, vm)? {
363 Err(io_closed_error(vm))
364 } else {
365 Ok(())
366 }
367 }
368
369 fn check_readable(file: &PyObject, vm: &VirtualMachine) -> PyResult<()> {
370 if vm.call_method(file, "readable", ())?.try_to_bool(vm)? {

Callers 7

__enter__Method · 0.85
flushMethod · 0.85
isattyMethod · 0.85
writelinesMethod · 0.85
check_closedMethod · 0.85
slot_iterMethod · 0.85
readlineMethod · 0.85

Calls 3

file_closedFunction · 0.85
io_closed_errorFunction · 0.85
ErrClass · 0.50

Tested by

no test coverage detected