mirror of
https://gitlab.com/dslackw/slpkg.git
synced 2024-11-17 07:48:18 +01:00
Updated for raise an exception
This commit is contained in:
parent
19e3f48581
commit
48dea12e56
1 changed files with 6 additions and 2 deletions
|
@ -17,5 +17,9 @@ class Blacklist(Configs):
|
|||
""" Reads the blacklist file. """
|
||||
file = Path(self.etc_path, 'blacklist.toml')
|
||||
if file.is_file():
|
||||
try:
|
||||
with open(file, 'rb') as black:
|
||||
return tomli.load(black)['blacklist']['packages']
|
||||
except tomli.TOMLDecodeError as error:
|
||||
raise SystemExit(f"\nValueError: {error}: in the configuration file "
|
||||
"'/etc/slpkg/blacklist.toml'\n")
|
||||
|
|
Loading…
Reference in a new issue