mirror of
https://github.com/spotipy-dev/spotipy.git
synced 2026-06-19 01:03: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
|
||||
- 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
|
||||
|
||||
@ -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()
|
||||
|
||||
Loading…
Reference in New Issue
Block a user