MCPcopy
hub / github.com/amoffat/sh / handle_process_exit_code

Function handle_process_exit_code

src/sh/__init__.py:1824–1835  ·  view source on GitHub ↗

this should only ever be called once for each child process

(exit_code)

Source from the content-addressed store, hash-verified

1822
1823
1824def handle_process_exit_code(exit_code):
1825 """this should only ever be called once for each child process"""
1826 # if we exited from a signal, let our exit code reflect that
1827 if os.WIFSIGNALED(exit_code):
1828 exit_code = -os.WTERMSIG(exit_code)
1829 # otherwise just give us a normal exit code
1830 elif os.WIFEXITED(exit_code):
1831 exit_code = os.WEXITSTATUS(exit_code)
1832 else:
1833 raise RuntimeError("Unknown child exit status!")
1834
1835 return exit_code
1836
1837
1838def no_interrupt(syscall, *args, **kwargs):

Callers 2

is_aliveMethod · 0.85
waitMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected