mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] bbremote: fix the exit usage
@ 2021-02-24 10:15 Marco Felsch
  2021-02-24 13:22 ` Rouven Czerwinski
  0 siblings, 1 reply; 3+ messages in thread
From: Marco Felsch @ 2021-02-24 10:15 UTC (permalink / raw)
  To: barebox

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.

Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
---
 scripts/remote/main.py | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/scripts/remote/main.py b/scripts/remote/main.py
index cef5d92ee2..37be5a35f0 100644
--- a/scripts/remote/main.py
+++ b/scripts/remote/main.py
@@ -14,7 +14,7 @@ try:
     import serial
 except:
     print("error: No python-serial package found", file=sys.stderr)
-    exit(2)
+    sys.exit(2)
 
 
 def versiontuple(v):
@@ -279,15 +279,15 @@ logging.basicConfig(level=VERBOSITY[args.verbose],
                     format='%(levelname)-8s %(module)-8s %(funcName)-16s %(message)s')
 try:
     res = args.func(args)
-    exit(res)
+    sys.exit(res)
 except RatpError as detail:
     print("Ratp error:", detail, file=sys.stderr);
-    exit(127)
+    sys.exit(127)
 except KeyboardInterrupt:
     print("\nInterrupted", file=sys.stderr);
-    exit(1)
+    sys.exit(1)
 #try:
 #    res = args.func(args)
 #except Exception as e:
 #    print("error: failed to establish connection: %s" % e, file=sys.stderr)
-#    exit(2)
+#    sys.exit(2)
-- 
2.29.2


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-03-01 15:52 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-24 10:15 [PATCH] bbremote: fix the exit usage Marco Felsch
2021-02-24 13:22 ` Rouven Czerwinski
2021-03-01 15:50   ` Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox