summaryrefslogtreecommitdiff
path: root/script
diff options
context:
space:
mode:
authorJoseph Sutton <josephsutton@catalyst.net.nz>2023-04-20 09:20:38 +1200
committerAndrew Bartlett <abartlet@samba.org>2023-05-05 02:54:31 +0000
commitdd88d7a89f2896a4535fe61cce44076888cbaef6 (patch)
tree8dc526c52c52c47081639382b7294287fde68552 /script
parentd497829bf1abd37eb87896d7826e00d41767ae20 (diff)
downloadsamba-dd88d7a89f2896a4535fe61cce44076888cbaef6.tar.gz
param: Fix resource leak
Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'script')
-rw-r--r--script/generate_param.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/script/generate_param.py b/script/generate_param.py
index 4a4f7fec878..50f2d12599a 100644
--- a/script/generate_param.py
+++ b/script/generate_param.py
@@ -51,10 +51,10 @@ def iterate_all(path):
"""
try:
- p = open(path, 'r')
+ with open(path, 'r') as p:
+ out = p.read()
except IOError as e:
raise Exception("Error opening parameters file")
- out = p.read()
# parse the parameters xml file
root = ET.fromstring(out)