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

Function enable

crates/stdlib/src/faulthandler.rs:454–470  ·  view source on GitHub ↗
(args: EnableArgs, vm: &VirtualMachine)

Source from the content-addressed store, hash-verified

452 // faulthandler_py_enable
453 #[pyfunction]
454 fn enable(args: EnableArgs, vm: &VirtualMachine) -> PyResult<()> {
455 // Get file descriptor
456 let fd = get_fd_from_file_opt(args.file, vm)?;
457
458 // Store fd and all_threads in global state
459 FATAL_ERROR.fd.store(fd, Ordering::Relaxed);
460 FATAL_ERROR
461 .all_threads
462 .store(args.all_threads, Ordering::Relaxed);
463
464 // Install signal handlers
465 if !faulthandler_enable_internal() {
466 return Err(vm.new_runtime_error("Failed to enable faulthandler"));
467 }
468
469 Ok(())
470 }
471
472 // Signal handlers
473

Callers

nothing calls this directly

Calls 4

get_fd_from_file_optFunction · 0.85
ErrClass · 0.50
storeMethod · 0.45

Tested by

no test coverage detected