spotipy: TypeError in oauth2
In file spotipy/oauth2.py in Class SpotifyAuthBase method __del__. Both arguments were of different types.
File "C:\Storage\Python Programs\project_vid_ed\.vEnv\lib\site-packages\spotipy\oauth2.py", line 156, in __del__
TypeError: isinstance() arg 2 must be a type, a tuple of types, or a union
Before the code was:
def __del__(self):
"""Make sure the connection (pool) gets closed"""
if isinstance(self._session,requests.Session):
self._session.close()
After fixing:
def __del__(self):
"""Make sure the connection (pool) gets closed"""
# print(type(self._session))
if isinstance(type(self._session),type(requests.Session)):
self._session.close()
Environment:
- OS: Windows 11
- Python version: 3.10.4
- spotipy version: 2.21.0
- IDE: Visual Studio Code
About this issue
- Original URL
- State: open
- Created 2 years ago
- Comments: 15 (1 by maintainers)
Sorry Niko, I totally changed my code in the meantime and the problem went away, hence my lack of example -offering.
On Fri, Jul 21, 2023, 06:10 Niko @.***> wrote: