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

Function ensure_unclosed

crates/vm/src/stdlib/_io.rs:164–170  ·  view source on GitHub ↗
(file: &PyObject, msg: &str, vm: &VirtualMachine)

Source from the content-addressed store, hash-verified

162 }
163
164 fn ensure_unclosed(file: &PyObject, msg: &str, vm: &VirtualMachine) -> PyResult<()> {
165 if file.get_attr("closed", vm)?.try_to_bool(vm)? {
166 Err(vm.new_value_error(msg))
167 } else {
168 Ok(())
169 }
170 }
171
172 /// Check if an error is an OSError with errno == EINTR.
173 /// If so, call check_signals() and return Ok(None) to indicate retry.

Callers 9

seekMethod · 0.85
readMethod · 0.85
peekMethod · 0.85
read1Method · 0.85
readintoMethod · 0.85
readinto1Method · 0.85
flushMethod · 0.85
writeMethod · 0.85
flushMethod · 0.85

Calls 3

try_to_boolMethod · 0.80
ErrClass · 0.50
get_attrMethod · 0.45

Tested by

no test coverage detected