Add exception handling

merge-requests/30/head
Bob Mottram 2024-07-18 13:41:23 +01:00
parent 0d291b9292
commit a28030d6e1
1 changed files with 15 additions and 10 deletions

View File

@ -872,8 +872,13 @@ def is_artist(base_dir: str, nickname: str) -> bool:
return True
return False
lines = []
try:
with open(artists_file, 'r', encoding='utf-8') as fp_artists:
lines = fp_artists.readlines()
except OSError:
print('EX: is_artist unable to read ' + artists_file)
if len(lines) == 0:
admin_name = get_config_param(base_dir, 'admin')
if admin_name: