mirror of
https://gitlab.com/dslackw/slpkg.git
synced 2024-11-17 07:48:18 +01:00
Updated for JSONDecodeError
This commit is contained in:
parent
da4ec2b433
commit
a00966e9d5
1 changed files with 3 additions and 0 deletions
|
@ -49,6 +49,7 @@ class LoadData(Configs):
|
|||
Returns:
|
||||
Dictionary with data.
|
||||
"""
|
||||
json_data: dict = {}
|
||||
try:
|
||||
json_data: dict = json.loads(file.read_text(encoding='utf-8'))
|
||||
except FileNotFoundError:
|
||||
|
@ -57,6 +58,8 @@ class LoadData(Configs):
|
|||
print('\nNeed to update the database first, please run:\n')
|
||||
print(f"{'':>2} $ {self.green}slpkg update{self.endc}\n")
|
||||
raise SystemExit(1)
|
||||
except json.decoder.JSONDecodeError:
|
||||
pass
|
||||
return json_data
|
||||
|
||||
def _remove_blacklist_from_all_repos(self, data: dict) -> dict:
|
||||
|
|
Loading…
Reference in a new issue