Switch to raise the error

Signed-off-by: Dimitris Zlatanidis <d.zlatanidis@gmail.com>
This commit is contained in:
Dimitris Zlatanidis 2022-05-11 23:39:16 +03:00
parent 8e0fb1dd2a
commit 2e92d854e0
2 changed files with 4 additions and 6 deletions

View file

@ -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():

View file

@ -62,4 +62,4 @@ def sbo_list():
"""
for pkg in os.listdir(_meta_.pkg_path):
if pkg.endswith("_SBo"):
yield pkg
yield pkg