mirror of
https://github.com/samba-team/samba.git
synced 2025-12-14 20:23:54 +03:00
python/samba: Avoid resource leak
View with 'git show -b'. Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
This commit is contained in:
committed by
Andrew Bartlett
parent
8d48ca4698
commit
60682e2aee
@@ -176,7 +176,7 @@ def read_ms_ldif(filename):
|
|||||||
out = []
|
out = []
|
||||||
|
|
||||||
from io import open
|
from io import open
|
||||||
f = open(filename, "r", encoding='latin-1')
|
with open(filename, "r", encoding='latin-1') as f:
|
||||||
for entry in __read_raw_entries(f):
|
for entry in __read_raw_entries(f):
|
||||||
out.append(__write_ldif_one(__transform_entry(entry)))
|
out.append(__write_ldif_one(__transform_entry(entry)))
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user