MCPcopy Index your code
hub / github.com/bpython/bpython / extract_exit_value

Function extract_exit_value

bpython/repl.py:1308–1317  ·  view source on GitHub ↗

Given the arguments passed to `SystemExit`, return the value that should be passed to `sys.exit`.

(args: tuple[Any, ...])

Source from the content-addressed store, hash-verified

1306
1307
1308def extract_exit_value(args: tuple[Any, ...]) -> Any:
1309 """Given the arguments passed to `SystemExit`, return the value that
1310 should be passed to `sys.exit`.
1311 """
1312 if len(args) == 0:
1313 return None
1314 elif len(args) == 1:
1315 return args[0]
1316 else:
1317 return args

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected