Less indentation

merge-requests/30/head
Bob Mottram 2024-07-02 20:59:47 +01:00
parent 76d0bcf3fd
commit 86e963abc0
1 changed files with 18 additions and 14 deletions

View File

@ -86,8 +86,12 @@ def get_pet_name(base_dir: str, nickname: str, domain: str,
if not os.path.isfile(petnames_filename):
return ''
petnames_str = ''
try:
with open(petnames_filename, 'r', encoding='utf-8') as petnames_file:
petnames_str = petnames_file.read()
except OSError:
print('EX: get_pet_name unable to read ' + petnames_filename)
if ' ' + handle + '\n' in petnames_str:
petnames_list = petnames_str.split('\n')
for pet in petnames_list: