diff --git a/CHANGELOG.md b/CHANGELOG.md index c567ec6..4cc825f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Updated links to Spotify in documentation - Improve usability on README.md - Fix `user_playlists_contents` example. +- 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 - Fixed unused description parameter in playlist creation example diff --git a/spotipy/client.py b/spotipy/client.py index a026e41..7d81b1f 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()