diff mbox series

[2/3] scripts/patchreview: use context manager when opening file

Message ID 20251211175908.3952420-2-ross.burton@arm.com
State New
Headers show
Series [1/3] oeqa: open JSON to parse in a context manager | expand

Commit Message

Ross Burton Dec. 11, 2025, 5:59 p.m. UTC
To avoid warnings about unclosed files.

Signed-off-by: Ross Burton <ross.burton@arm.com>
---
 scripts/contrib/patchreview.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/scripts/contrib/patchreview.py b/scripts/contrib/patchreview.py
index d8d7b214e5c..dcf20937a8f 100755
--- a/scripts/contrib/patchreview.py
+++ b/scripts/contrib/patchreview.py
@@ -253,7 +253,8 @@  if __name__ == "__main__":
 
     if args.json:
         if os.path.isfile(args.json):
-            data = json.load(open(args.json))
+            with open(args.json) as f:
+                data = json.load(f)
         else:
             data = []