From 608737ccc37a416a4da7cb8b185745fe42abfee2 Mon Sep 17 00:00:00 2001 From: "Marlon (esolitos) Saglia" Date: Wed, 3 Jan 2024 11:21:01 +0100 Subject: [PATCH] fix: C0209: Formatting a regular string which could be a f-string --- swa/spotifyoauthredis.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/swa/spotifyoauthredis.py b/swa/spotifyoauthredis.py index 27dfbb1..98a37b4 100644 --- a/swa/spotifyoauthredis.py +++ b/swa/spotifyoauthredis.py @@ -43,11 +43,8 @@ def spotify_oauth(email: str) -> spotipy.SpotifyOAuth: '-'.join(('swa-user', email)), ) else: - cache_handler = spotipy.oauth2.CacheFileHandler( - cache_path='.cache/user-%s' % - hashlib.sha1( - email.encode(), - usedforsecurity=False).hexdigest()) + cache_path = f'.cache/user-{hashlib.sha1(email.encode()).hexdigest()}' + cache_handler = spotipy.oauth2.CacheFileHandler(cache_path) return spotipy.SpotifyOAuth( client_id=client_id,