From: Michael Tremer Date: Wed, 8 Dec 2021 18:19:36 +0000 (+0000) Subject: pakfire: Refactor printing errors to console X-Git-Tag: 0.9.28~853 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bba8aa7624f1c33523cce77e60d228de4fb1167f;p=pakfire.git pakfire: Refactor printing errors to console Signed-off-by: Michael Tremer --- diff --git a/src/scripts/pakfire.in b/src/scripts/pakfire.in index 97672c496..b77698e08 100644 --- a/src/scripts/pakfire.in +++ b/src/scripts/pakfire.in @@ -274,15 +274,15 @@ class Cli(object): # Call function try: - ret = args.func(p, args) + r = args.func(p, args) # Catch invalid inputs except ValueError as e: - sys.stderr.write("%s\n" % e) - ret = 2 + print("%s" % e, file=sys.stderr) + r = 2 # Return with exit code - sys.exit(ret or 0) + sys.exit(r or 0) def _check(self, p, args): """