From 2e92d854e01012e7de3b3673009133c8381ddd2d Mon Sep 17 00:00:00 2001 From: Dimitris Zlatanidis Date: Wed, 11 May 2022 23:39:16 +0300 Subject: [PATCH] Switch to raise the error Signed-off-by: Dimitris Zlatanidis --- slpkg/main.py | 8 +++----- slpkg/sbo/check.py | 2 +- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/slpkg/main.py b/slpkg/main.py index 758faeaf..d76f78ba 100644 --- a/slpkg/main.py +++ b/slpkg/main.py @@ -688,8 +688,7 @@ class ArgParse(BlackList): self.args.remove(arg) break if tag and tag not in colors: - print(f"\nslpkg: Error: Available colors {colors}\n") - raise SystemExit(1) + raise SystemExit(f"\nslpkg: Error: Available colors {colors}\n") if (len(self.args) == 3 and self.args[0] in options and self.args[1] in self.meta.repositories and tag in colors): PkgDesc(self.args[2], self.args[1], tag).view() @@ -788,9 +787,8 @@ class ArgParse(BlackList): try: from dialog import Dialog except ImportError: - print("Require 'pythondialog': Install with 'slpkg -s sbo " - "python3-pythondialog'") - raise SystemExit(1) + raise SystemExit("Require 'pythondialog': Install with 'slpkg " + "-s sbo python3-pythondialog'") def main(): diff --git a/slpkg/sbo/check.py b/slpkg/sbo/check.py index d26a04dd..78c42312 100644 --- a/slpkg/sbo/check.py +++ b/slpkg/sbo/check.py @@ -62,4 +62,4 @@ def sbo_list(): """ for pkg in os.listdir(_meta_.pkg_path): if pkg.endswith("_SBo"): - yield pkg \ No newline at end of file + yield pkg