Given the arguments passed to `SystemExit`, return the value that should be passed to `sys.exit`.
(args: tuple[Any, ...])
| 1306 | |
| 1307 | |
| 1308 | def 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 |