Cleanup: Remove pointless calls to close()
Since "with open()" automatically closes the files anyway.
This commit is contained in:
@@ -107,7 +107,6 @@ def heroic_parser(parent_widget, action):
|
||||
os.path.join(heroic_dir, "lib-cache", "library.json"), "r"
|
||||
) as open_file:
|
||||
data = open_file.read()
|
||||
open_file.close()
|
||||
library = json.loads(data)
|
||||
|
||||
try:
|
||||
@@ -160,7 +159,6 @@ def heroic_parser(parent_widget, action):
|
||||
os.path.join(heroic_dir, "gog_store", "installed.json"), "r"
|
||||
) as open_file:
|
||||
data = open_file.read()
|
||||
open_file.close()
|
||||
installed = json.loads(data)
|
||||
for item in installed["installed"]:
|
||||
values = {}
|
||||
@@ -179,7 +177,6 @@ def heroic_parser(parent_widget, action):
|
||||
os.path.join(heroic_dir, "gog_store", "library.json"), "r"
|
||||
) as open_file:
|
||||
data = open_file.read()
|
||||
open_file.close()
|
||||
library = json.loads(data)
|
||||
for game in library["games"]:
|
||||
if game["app_name"] == app_name:
|
||||
@@ -214,7 +211,6 @@ def heroic_parser(parent_widget, action):
|
||||
os.path.join(heroic_dir, "sideload_apps", "library.json"), "r"
|
||||
) as open_file:
|
||||
data = open_file.read()
|
||||
open_file.close()
|
||||
library = json.loads(data)
|
||||
for item in library["games"]:
|
||||
values = {}
|
||||
|
||||
Reference in New Issue
Block a user