From a6724210572726bcfa6b00b7b297f02576eb9706 Mon Sep 17 00:00:00 2001 From: Robin <167366979+allrob23@users.noreply.github.com> Date: Thu, 10 Oct 2024 16:52:13 -0300 Subject: [PATCH] update main.py to avoid resource leak --- main.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main.py b/main.py index a9155eb..41151c3 100644 --- a/main.py +++ b/main.py @@ -469,8 +469,8 @@ class TodoParser(object): if not os.path.exists(path) or not os.path.isfile(path): print(f'Cannot retrieve custom language file "{path}".') continue - f = open(path) - data = json.load(f) + with open(path) as f: + data = json.load(f) # Iterate through the definitions. for lang in data: