Skip to content

Commit 8f00a1c

Browse files
authored
Merge pull request #331 from EbbLabs/feature/consistent_open
Consistent use of path file open
2 parents 6fe4788 + 9847120 commit 8f00a1c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

tidalapi/session.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -631,14 +631,14 @@ def save_session_to_file(self, session_file: Path):
631631
"is_pkce": {"data": self.is_pkce},
632632
# "expiry_time": {"data": self.expiry_time},
633633
}
634-
with session_file.open("w") as outfile:
635-
json.dump(data, outfile)
634+
with session_file.open("w") as file:
635+
json.dump(data, file)
636636

637637
def load_session_from_file(self, session_file: Path):
638638
try:
639-
with open(session_file) as f:
639+
with session_file.open("r") as file:
640640
log.info("Loading session from %s...", session_file)
641-
data = json.load(f)
641+
data = json.load(file)
642642
except Exception as e:
643643
log.info("Could not load session from %s: %s", session_file, e)
644644
return False

0 commit comments

Comments
 (0)