Skip to content

Commit 88f7b4f

Browse files
authored
Use auto resource management for license file (#330)
1 parent 7a416cb commit 88f7b4f

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

usr/lib/webapp-manager/webapp-manager.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -238,12 +238,8 @@ def open_about(self, widget):
238238
dlg.set_program_name(_("Web Apps"))
239239
dlg.set_comments(_("Run websites as if they were apps"))
240240
try:
241-
h = open('/usr/share/common-licenses/GPL', encoding="utf-8")
242-
s = h.readlines()
243-
gpl = ""
244-
for line in s:
245-
gpl += line
246-
h.close()
241+
with open('/usr/share/common-licenses/GPL', encoding="utf-8") as h:
242+
gpl = h.read()
247243
dlg.set_license(gpl)
248244
except Exception as e:
249245
print(e)

0 commit comments

Comments
 (0)