MCPcopy Create free account
hub / github.com/dylan-sutton-chavez/edge-python / system_exit_code

Method system_exit_code

compiler/src/modules/vm/helpers.rs:22–32  ·  view source on GitHub ↗

Intended process exit code when the last uncaught error is `SystemExit` with an integer (or absent/None) argument. `None` means "not a plain SystemExit", so the host renders a normal traceback; a non-int argument also yields `None` so its message surfaces as an error. */

(&self)

Source from the content-addressed store, hash-verified

20
21 /* Intended process exit code when the last uncaught error is `SystemExit` with an integer (or absent/None) argument. `None` means "not a plain SystemExit", so the host renders a normal traceback; a non-int argument also yields `None` so its message surfaces as an error. */
22 pub fn system_exit_code(&self) -> Option<i64> {
23 let exc = self.pending.exc_val?;
24 let HeapObj::ExcInstance(name, args) = self.heap.get(exc) else { return None; };
25 if name != "SystemExit" { return None; }
26 match args.first() {
27 None => Some(0),
28 Some(a) if a.is_none() => Some(0),
29 Some(a) if a.is_int() => Some(a.as_int()),
30 _ => None,
31 }
32 }
33
34 pub fn call_stack_frames(&self) -> &[CallFrame] { &self.call_stack }
35 pub fn function_names_ref(&self) -> &[String] { &self.function_names }

Callers 1

step_vmFunction · 0.80

Calls 4

is_noneMethod · 0.80
is_intMethod · 0.80
as_intMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected