[issue24053] Define EXIT_SUCCESS and EXIT_FAILURE constants in sys

Elliot Edmunds report at bugs.python.org
Wed Dec 12 13:58:48 EST 2018


Elliot Edmunds <edmundselliot at gmail.com> added the comment:

I have personally come across situations where I am calling a Python script from a C program and would like to check the exit codes of the script, and have had to write sys.exit(1) and sys.exit(0) in Python, and compared them to EXIT_SUCCESS/EXIT_FAILURE in C. It would have been easy to introduce a bug where I returned the wrong exit code, so I was hoping they would have been implemented in sys.

It seems like a no-brainer to add these, they reduce magic number use and improve the accessibility of Python to people coming from C. I would love to add these if everyone is OK with it.

----------
nosy: +Elliot Edmunds
versions: +Python 3.8 -Python 3.5

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue24053>
_______________________________________


More information about the Python-bugs-list mailing list