From 6cc817af85c167c5c0099fdd78635e6411c58266 Mon Sep 17 00:00:00 2001 From: John Cheng Date: Tue, 11 Apr 2023 23:29:37 -0400 Subject: [PATCH 1/3] ignore if _session does not exist --- spotipy/client.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/spotipy/client.py b/spotipy/client.py index d3b918f..91db14a 100644 --- a/spotipy/client.py +++ b/spotipy/client.py @@ -211,8 +211,11 @@ class Spotify(object): def __del__(self): """Make sure the connection (pool) gets closed""" - if isinstance(self._session, requests.Session): - self._session.close() + try: + if isinstance(self._session, requests.Session): + self._session.close() + except AttributeError: + pass def _build_session(self): self._session = requests.Session() From f647ca75c2a1cde12a2c06703e117e7b7dab0857 Mon Sep 17 00:00:00 2001 From: John Cheng Date: Fri, 26 May 2023 19:51:59 -0400 Subject: [PATCH 2/3] update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index f69d8fc..a6d4ace 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed - Changes the YouTube video link for authentication tutorial (the old video was in low definition, the new one is in high definition) - Updated links to Spotify in documentation +- Fixed error obfuscation when Spotify class is being inherited and an error is raised in the Child's __init__ ## [2.23.0] - 2023-04-07 From 17893a611539cb23306a4aeeb96b876c90819b98 Mon Sep 17 00:00:00 2001 From: Niko Date: Wed, 15 May 2024 16:14:30 +0200 Subject: [PATCH 3/3] Update CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a6d4ace..a4dbc7f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,7 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed - Changes the YouTube video link for authentication tutorial (the old video was in low definition, the new one is in high definition) - Updated links to Spotify in documentation -- Fixed error obfuscation when Spotify class is being inherited and an error is raised in the Child's __init__ +- Fixed error obfuscation when Spotify class is being inherited and an error is raised in the Child's `__init__` ## [2.23.0] - 2023-04-07