From bd32818381ecb1a44c3b25d6c9c2e23ab552da9a Mon Sep 17 00:00:00 2001 From: hduelme Date: Wed, 29 Jan 2025 23:38:36 +0100 Subject: [PATCH] Use auto resource management for license file --- usr/lib/linuxmint/mintinstall/mintinstall.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/usr/lib/linuxmint/mintinstall/mintinstall.py b/usr/lib/linuxmint/mintinstall/mintinstall.py index 8002be3..4c30ac1 100755 --- a/usr/lib/linuxmint/mintinstall/mintinstall.py +++ b/usr/lib/linuxmint/mintinstall/mintinstall.py @@ -1780,12 +1780,8 @@ def open_about(self, widget): dlg.set_program_name("mintinstall") dlg.set_comments(_("Software Manager")) try: - h = open('/usr/share/common-licenses/GPL', 'r') - s = h.readlines() - gpl = "" - for line in s: - gpl += line - h.close() + with open('/usr/share/common-licenses/GPL', 'r') as h: + gpl = h.read() dlg.set_license(gpl) except Exception as e: print(e)