Use simpler syntax for I/O operations
This commit is contained in:
@@ -277,8 +277,7 @@ def create_details_window(parent_widget, game_id=None):
|
||||
path = parent_widget.data_dir / "cartridges" / "games" / f"{game_id}.json"
|
||||
|
||||
if path.exists():
|
||||
with open(path, "r") as open_file:
|
||||
data = json.loads(open_file.read())
|
||||
data = json.loads(path.read_text())
|
||||
data.update(values)
|
||||
save_game(parent_widget, data)
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user