mirror of
https://github.com/spotipy-dev/spotipy.git
synced 2026-10-12 17:10:45 +00:00
Merge pull request #964 from johncheng2011/bug/inheriting-exceptions-in-init
Ignore Attribute error in Spotify.__del__
This commit is contained in:
2 files changed
+7
-2
No files matched your search
@@ -19,6 +19,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
- Updated links to Spotify in documentation
|
- Updated links to Spotify in documentation
|
||||||
- Improve usability on README.md
|
- Improve usability on README.md
|
||||||
- Fix `user_playlists_contents` example.
|
- 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
|
||||||
- Fixed unused description parameter in playlist creation example
|
- Fixed unused description parameter in playlist creation example
|
||||||
|
|||||||
+5
-2
@@ -211,8 +211,11 @@ class Spotify(object):
|
|||||||
|
|
||||||
def __del__(self):
|
def __del__(self):
|
||||||
"""Make sure the connection (pool) gets closed"""
|
"""Make sure the connection (pool) gets closed"""
|
||||||
if isinstance(self._session, requests.Session):
|
try:
|
||||||
self._session.close()
|
if isinstance(self._session, requests.Session):
|
||||||
|
self._session.close()
|
||||||
|
except AttributeError:
|
||||||
|
pass
|
||||||
|
|
||||||
def _build_session(self):
|
def _build_session(self):
|
||||||
self._session = requests.Session()
|
self._session = requests.Session()
|
||||||
|
|||||||
Reference in new issue
Block a user