Skip to content

Commit

Permalink
Use format instead of fstring for python3.5
Browse files Browse the repository at this point in the history
  • Loading branch information
pyepye committed Jun 1, 2020
1 parent 72adb96 commit 7bbbefb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
10 changes: 8 additions & 2 deletions paddle/paddle.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,17 @@ def __init__(self, error):
self.message = str(error)
if isinstance(error, requests.HTTPError): # pragma: no cover - Unsure how to trigger a HTTPError here # NOQA: E501
self.code = int(error.response.status_code)
self.message = f'HTTP error {self.code} - {error.response.content.decode("utf-8")}' # NOQA
self.message = 'HTTP error {0} - {1}'.format(
self.code,
error.response.content.decode('utf-8'),
)
elif isinstance(error, dict):
try:
self.code = int(error['code'])
self.message = f'Paddle error {error["code"]} - {error["message"]}' # NOQA
self.message = 'Paddle error {0} - {1}'.format(
error['code'],
error['message'],
)
except KeyError: # pragma: no cover - Not sure if this is even possible # NOQA: E501
pass

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "paddle-python"
packages = [
{include = "paddle"}
]
version = "0.5.0"
version = "0.5.1"
description = "Python wrapper around the Paddle.com API"
license = "MIT"
authors = ["Matt Pye <[email protected]>"]
Expand Down

0 comments on commit 7bbbefb

Please sign in to comment.