Use simpler syntax for I/O operations

This commit is contained in:
kramo
2023-04-01 16:14:19 +02:00
parent 3bcbf8457c
commit 6899246d01
7 changed files with 12 additions and 20 deletions

View File

@@ -33,8 +33,7 @@ def get_games(parent_widget, game_ids=None):
game_files = games_dir.iterdir()
for game in game_files:
with open((games_dir / game), "r") as open_file:
data = json.loads(open_file.read())
data = json.loads((games_dir / game).read_text())
games[data["game_id"]] = data
return games