Skip to content

Commit 611d74d

Browse files
authored
Use auto resource management for license file (#453)
1 parent b0f942c commit 611d74d

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

usr/lib/linuxmint/mintinstall/mintinstall.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1780,12 +1780,8 @@ def open_about(self, widget):
17801780
dlg.set_program_name("mintinstall")
17811781
dlg.set_comments(_("Software Manager"))
17821782
try:
1783-
h = open('/usr/share/common-licenses/GPL', 'r')
1784-
s = h.readlines()
1785-
gpl = ""
1786-
for line in s:
1787-
gpl += line
1788-
h.close()
1783+
with open('/usr/share/common-licenses/GPL', 'r') as h:
1784+
gpl = h.read()
17891785
dlg.set_license(gpl)
17901786
except Exception as e:
17911787
print(e)

0 commit comments

Comments
 (0)