Skip to content

Commit

Permalink
calls open()
Browse files Browse the repository at this point in the history
  • Loading branch information
JackDyre committed Aug 9, 2024
1 parent 68a5399 commit 6b1d7da
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions spotipy/cache_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def get_cached_token(self) -> TokenInfo | None:
token_info: TokenInfo | None = None

try:
with Path(self.cache_path).open("r") as f:
with open(self.cache_path) as f:
token_info = json.load(f)

except OSError as error:
Expand All @@ -99,7 +99,7 @@ def get_cached_token(self) -> TokenInfo | None:
def save_token_to_cache(self, token_info: TokenInfo) -> None:
"""Save token cache to file."""
try:
with Path(self.cache_path).open("w") as f:
with open(self.cache_path, "w") as f:
json.dump(token_info, f, cls=self.encoder_cls)
except OSError:
logger.warning("Couldn't write token to cache at: %s", self.cache_path)
Expand Down

0 comments on commit 6b1d7da

Please sign in to comment.