Skip to content

Commit

Permalink
Revert "Fixed UnboundLocalError #571 (#580)" (#582)
Browse files Browse the repository at this point in the history
This reverts commit 18e82b6.
  • Loading branch information
stephanebruckert committed Oct 6, 2020
1 parent 18e82b6 commit 76b640a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
5 changes: 1 addition & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## Unreleased

### Fixed

- UnboundLocalError when a request fails ( #571 )

// Add your changes here and then delete this line

## [2.16.0] - 2020-09-16

Expand Down
6 changes: 2 additions & 4 deletions spotipy/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,8 +243,7 @@ def _internal_call(self, method, url, payload, params):

response.raise_for_status()
results = response.json()
except requests.exceptions.HTTPError as http_error:
response = http_error.response
except requests.exceptions.HTTPError:
try:
msg = response.json()["error"]["message"]
except (ValueError, KeyError):
Expand All @@ -264,8 +263,7 @@ def _internal_call(self, method, url, payload, params):
reason=reason,
headers=response.headers,
)
except requests.exceptions.RetryError as retry_error:
response = retry_error.response
except requests.exceptions.RetryError:
logger.error('Max Retries reached')
raise SpotifyException(
599,
Expand Down

0 comments on commit 76b640a

Please sign in to comment.