mirror of
https://github.com/spotipy-dev/spotipy.git
synced 2026-06-19 09:13:53 +00:00
Merge pull request #964 from johncheng2011/bug/inheriting-exceptions-in-init
Ignore Attribute error in Spotify.__del__
This commit is contained in:
commit
028539e08a
@ -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
|
||||||
|
|||||||
@ -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"""
|
||||||
|
try:
|
||||||
if isinstance(self._session, requests.Session):
|
if isinstance(self._session, requests.Session):
|
||||||
self._session.close()
|
self._session.close()
|
||||||
|
except AttributeError:
|
||||||
|
pass
|
||||||
|
|
||||||
def _build_session(self):
|
def _build_session(self):
|
||||||
self._session = requests.Session()
|
self._session = requests.Session()
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user