mirror of
https://github.com/spotipy-dev/spotipy.git
synced 2026-10-12 09:10:45 +00:00
ignore if _session does not exist
This commit is contained in:
1 parent
45f78ce7a6
commit
6cc817af85
1 file changed
+5
-2
+5
-2
@@ -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()
|
||||
|
||||
Reference in new issue
Block a user