Less indentation

main
Bob Mottram 2024-07-02 21:01:26 +01:00
parent 86e963abc0
commit 687c088f45
1 changed files with 12 additions and 8 deletions

View File

@ -117,8 +117,12 @@ def _get_pet_name_handle(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_handle unable to read ' + petnames_filename)
if petname + ' ' in petnames_str:
petnames_list = petnames_str.split('\n')
for pet in petnames_list: