Skip to content

Commit

Permalink
Handle the case of SystemExit()/SystemExit(None).
Browse files Browse the repository at this point in the history
  • Loading branch information
freakboy3742 committed Jan 21, 2025
1 parent 3aeeaf5 commit 597bbed
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions {{ cookiecutter.format }}/bootstrap/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,10 @@ int main(int argc, char *argv[]) {
if (systemExit_code == NULL) {
debug_log("Could not determine exit code\n");
ret = -10;
} else if (systemExit_code == Py_None) {
// SystemExit with a code of None; documented as a return code
// of 0.
ret = 0;
} else if (PyLong_Check(systemExit_code)) {
// SystemExit with error code
ret = (int) PyLong_AsLong(systemExit_code);
Expand Down

0 comments on commit 597bbed

Please sign in to comment.