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

Method close_strict

crates/vm/src/stdlib/_io.rs:1768–1777  ·  view source on GitHub ↗
(&self, vm: &VirtualMachine)

Source from the content-addressed store, hash-verified

1766 }
1767
1768 fn close_strict(&self, vm: &VirtualMachine) -> PyResult {
1769 let mut data = self.lock(vm)?;
1770 let raw = data.check_init(vm)?;
1771 if file_closed(raw, vm)? {
1772 return Ok(vm.ctx.none());
1773 }
1774 let flush_res = data.flush(vm);
1775 let close_res = vm.call_method(data.raw.as_ref().unwrap(), "close", ());
1776 exception_chain(flush_res, close_res)
1777 }
1778
1779 #[pymethod]
1780 fn close(zelf: PyRef<Self>, vm: &VirtualMachine) -> PyResult {

Callers 1

closeMethod · 0.80

Implementers 1

_io.rscrates/vm/src/stdlib/_io.rs

Calls 9

file_closedFunction · 0.85
exception_chainFunction · 0.85
check_initMethod · 0.80
noneMethod · 0.80
lockMethod · 0.45
flushMethod · 0.45
call_methodMethod · 0.45
unwrapMethod · 0.45
as_refMethod · 0.45

Tested by

no test coverage detected