Skip to content
This repository has been archived by the owner on Jul 1, 2021. It is now read-only.

Commit

Permalink
fix rate-limit error if requests_cache not being used
Browse files Browse the repository at this point in the history
  • Loading branch information
jtpavlock committed Jul 19, 2020
1 parent 2a4166f commit aa006eb
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion nbapy/nba_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,15 @@ def _get_json(self):
)
response.raise_for_status()

if not response.from_cache:
cached_req = False
try:
if response.from_cache:
cached_req = True
except AttributeError:
# requests_cache not being used
pass

if not cached_req:
self.last_call = time.time()

return response.json()

0 comments on commit aa006eb

Please sign in to comment.