Skip to content
This repository has been archived by the owner on Aug 25, 2020. It is now read-only.

Commit

Permalink
Fix SystemExit exceptions with an error message not being printed to …
Browse files Browse the repository at this point in the history
…stderr on windows and macOS builds
  • Loading branch information
kovidgoyal committed Jul 24, 2017
1 parent 3e7cdb1 commit 5804dc1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions scripts/freeze/osx/util.c
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,10 @@ int handle_sysexit(PyObject *e) {

code = PyObject_GetAttrString(e, "code");
if (!code) return 0;
if (!PyInt_Check(code)) {
PyObject_Print(code, stderr, Py_PRINT_RAW);
fflush(stderr);
}
return pyobject_to_int(code);
}

Expand Down
4 changes: 4 additions & 0 deletions scripts/freeze/windows/util.c
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,10 @@ int handle_sysexit(PyObject *e) {

code = PyObject_GetAttrString(e, "code");
if (!code) return 0;
if (!PyInt_Check(code)) {
PyObject_Print(code, stderr, Py_PRINT_RAW);
fflush(stderr);
}
return pyobject_to_int(code);
}

Expand Down

0 comments on commit 5804dc1

Please sign in to comment.