mirror of
https://github.com/spotipy-dev/spotipy.git
synced 2026-06-19 01:03:53 +00:00
ignore if _session does not exist
This commit is contained in:
parent
45f78ce7a6
commit
6cc817af85
@ -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()
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user