Skip to content

Commit 82abaa5

Browse files
authored
Use auto resource management for license file (#71)
1 parent 37f91c7 commit 82abaa5

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

usr/lib/bulky/bulky.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -430,12 +430,8 @@ def open_about(self, widget):
430430
dlg.set_program_name("Bulky")
431431
dlg.set_comments(_("Rename Files"))
432432
try:
433-
h = open('/usr/share/common-licenses/GPL', encoding="utf-8")
434-
s = h.readlines()
435-
gpl = ""
436-
for line in s:
437-
gpl += line
438-
h.close()
433+
with open('/usr/share/common-licenses/GPL', encoding="utf-8") as h:
434+
gpl= h.read()
439435
dlg.set_license(gpl)
440436
except Exception as e:
441437
print (e)

0 commit comments

Comments
 (0)