Merge pull request #213 from allrob23/master

Improve file handling in `main.py`
This commit is contained in:
Alastair Mooney 2024-10-11 09:58:23 +01:00 committed by GitHub
commit 7ac233269b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -469,8 +469,8 @@ class TodoParser(object):
if not os.path.exists(path) or not os.path.isfile(path): if not os.path.exists(path) or not os.path.isfile(path):
print(f'Cannot retrieve custom language file "{path}".') print(f'Cannot retrieve custom language file "{path}".')
continue continue
f = open(path) with open(path) as f:
data = json.load(f) data = json.load(f)
# Iterate through the definitions. # Iterate through the definitions.
for lang in data: for lang in data: