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

Function check_tool_in_use

crates/vm/src/stdlib/sys/monitoring.rs:174–181  ·  view source on GitHub ↗
(tool: usize, vm: &VirtualMachine)

Source from the content-addressed store, hash-verified

172}
173
174fn check_tool_in_use(tool: usize, vm: &VirtualMachine) -> PyResult<()> {
175 let state = vm.state.monitoring.lock();
176 if state.tool_names[tool].is_some() {
177 Ok(())
178 } else {
179 Err(vm.new_value_error(format!("tool {tool} is not in use")))
180 }
181}
182
183fn parse_single_event(event: i32, vm: &VirtualMachine) -> PyResult<usize> {
184 let event = u32::try_from(event)

Callers 2

set_eventsFunction · 0.85
set_local_eventsFunction · 0.85

Calls 2

ErrClass · 0.50
lockMethod · 0.45

Tested by

no test coverage detected