mercurial/statprof.py
changeset 52580 f4d1f0713b49
parent 52377 ef83646d5f7d
child 52638 dc36535a5edc
--- a/mercurial/statprof.py	Tue Dec 17 01:31:17 2024 -0500
+++ b/mercurial/statprof.py	Tue Dec 17 01:35:52 2024 -0500
@@ -397,7 +397,8 @@
 
 
 def load_data(path):
-    lines = open(path, 'rb').read().splitlines()
+    with open(path, 'rb') as fp:
+        lines = fp.read().splitlines()
 
     state.accumulated_time = [float(value) for value in lines[0].split()]
     state.samples = []