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

Function exit

crates/vm/src/stdlib/builtins.rs:974–977  ·  view source on GitHub ↗
(exit_code_arg: OptionalArg<PyObjectRef>, vm: &VirtualMachine)

Source from the content-addressed store, hash-verified

972
973 #[pyfunction]
974 pub fn exit(exit_code_arg: OptionalArg<PyObjectRef>, vm: &VirtualMachine) -> PyResult {
975 let code = exit_code_arg.unwrap_or_else(|| vm.ctx.new_int(0).into());
976 Err(vm.new_exception(vm.ctx.exceptions.system_exit.to_owned(), vec![code]))
977 }
978
979 #[derive(Debug, Default, FromArgs)]
980 pub struct PrintOptions {

Callers 6

_exitFunction · 0.70
runMethod · 0.50
faulthandler_fatal_errorFunction · 0.50
watchdog_threadFunction · 0.50
execFunction · 0.50
exit_codeFunction · 0.50

Calls 4

new_exceptionMethod · 0.80
ErrClass · 0.50
new_intMethod · 0.45
to_ownedMethod · 0.45

Tested by

no test coverage detected