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

@@ -110,8 +110,7 @@ class game(Gtk.Box): # pylint: disable=invalid-name
if not games_dir.exists():
return
with open((games_dir / f"{self.game_id}.json") / "r") as open_file:
data = json.loads(open_file.read())
data = json.loads((games_dir / f"{self.game_id}.json").read_text())
data["hidden"] = not data["hidden"]