mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Marco Felsch <m.felsch@pengutronix.de>
To: barebox@lists.infradead.org
Subject: [PATCH] bbremote: fix the exit usage
Date: Wed, 24 Feb 2021 11:15:45 +0100	[thread overview]
Message-ID: <20210224101545.15009-1-m.felsch@pengutronix.de> (raw)

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


             reply	other threads:[~2021-02-24 10:17 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-24 10:15 Marco Felsch [this message]
2021-02-24 13:22 ` Rouven Czerwinski
2021-03-01 15:50   ` Sascha Hauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210224101545.15009-1-m.felsch@pengutronix.de \
    --to=m.felsch@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox