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

Method del

crates/vm/src/stdlib/os.rs:944–956  ·  view source on GitHub ↗
(zelf: &Py<Self>, vm: &VirtualMachine)

Source from the content-addressed store, hash-verified

942 }
943 impl Destructor for ScandirIterator {
944 fn del(zelf: &Py<Self>, vm: &VirtualMachine) -> PyResult<()> {
945 // Emit ResourceWarning if the iterator is not yet exhausted/closed
946 if zelf.entries.read().is_some() {
947 let _ = crate::stdlib::_warnings::warn(
948 vm.ctx.exceptions.resource_warning,
949 format!("unclosed scandir iterator {:?}", zelf.as_object()),
950 1,
951 vm,
952 );
953 zelf.close();
954 }
955 Ok(())
956 }
957 }
958 impl SelfIter for ScandirIterator {}
959 impl IterNext for ScandirIterator {

Callers

nothing calls this directly

Calls 4

warnFunction · 0.70
readMethod · 0.45
closeMethod · 0.45
lockMethod · 0.45

Tested by

no test coverage detected