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

Method lock

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

Source from the content-addressed store, hash-verified

2817 }
2818
2819 fn lock(&self, vm: &VirtualMachine) -> PyResult<PyMappedThreadMutexGuard<'_, TextIOData>> {
2820 let lock = self.lock_opt(vm)?;
2821 PyThreadMutexGuard::try_map(lock, |x| x.as_mut())
2822 .map_err(|_| vm.new_value_error("I/O operation on uninitialized object"))
2823 }
2824
2825 fn validate_errors(errors: &PyRef<PyUtf8Str>, vm: &VirtualMachine) -> PyResult<()> {
2826 if errors.as_str().contains('\0') {

Callers 15

nameMethod · 0.45
set_nameMethod · 0.45
qualnameMethod · 0.45
set_qualnameMethod · 0.45
readlineMethod · 0.45
statsMethod · 0.45
update_statsMethod · 0.45
collect_innerMethod · 0.45
fire_exception_traceMethod · 0.45
runMethod · 0.45
execute_instructionMethod · 0.45

Calls 2

lock_optMethod · 0.80
as_mutMethod · 0.45

Tested by

no test coverage detected