[PATCH] bbremote: fix the exit usage

Rouven Czerwinski r.czerwinski at pengutronix.de
Wed Feb 24 08:22:38 EST 2021


On Wed, 2021-02-24 at 11:15 +0100, Marco Felsch wrote:
> Unlike the sys.exit() function the builtin exit() function don't take an
> argument. Fix it by using the exit function from the sys module which is
> already imported.

This is not entirely correct, the builtin exit() function also takes an
exit code and works fine when I tested this:

  $ python3 -c "exit(1)"; echo $?

Nevertheless the documentation [1] says that sys.exit() should be used
in scripts. So the patch is fine, but the justification not entirely

[1]: https://docs.python.org/3/library/constants.html#constants-added-by-the-site-module

Rouven Czerwinski

More information about the barebox mailing list