File ".../douban.fm/build/lib/douban/douban_token.py", line 149, in requests_url
return s.text
UnboundLocalError: local variable 's' referenced before assignment
It refers following code.
try:
s = requests.get(url)
except requests.exceptions.RequestException:
logger.error("Error communicating with Douban.fm API.")
return s.text
It looks like that if requests.get failed, then s is unbound.
Here is part of the exception:
It refers following code.
It looks like that if requests.get failed, then
s
is unbound.