(args: EnableArgs, vm: &VirtualMachine)
| 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 |
nothing calls this directly
no test coverage detected