Skip to content

Commit

Permalink
small qa update (#69)
Browse files Browse the repository at this point in the history
* code quality checks
  • Loading branch information
EddyCMWF authored Feb 28, 2023
1 parent 30f4521 commit 1f41f82
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions cdsapi/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,8 +204,9 @@ def update(self, request_id=None):
task_url = "%s/tasks/%s" % (self._url, request_id)
self.debug("GET %s", task_url)

result = self.robust(self.session.get)(task_url, verify=self.verify,
timeout=self.timeout)
result = self.robust(self.session.get)(
task_url, verify=self.verify, timeout=self.timeout
)
result.raise_for_status()
self.reply = result.json()

Expand All @@ -219,8 +220,9 @@ def delete(self):
task_url = "%s/tasks/%s" % (self._url, rid)
self.debug("DELETE %s", task_url)

delete = self.session.delete(task_url, verify=self.verify,
timeout=self.timeout)
delete = self.session.delete(
task_url, verify=self.verify, timeout=self.timeout
)
self.debug("DELETE returns %s %s", delete.status_code, delete.reason)

try:
Expand Down Expand Up @@ -610,7 +612,6 @@ def retriable(code, reason):
def wrapped(*args, **kwargs):
tries = 0
while True:

txt = "Error"
try:
resp = call(*args, **kwargs)
Expand All @@ -637,7 +638,7 @@ def wrapped(*args, **kwargs):
time.sleep(self.sleep_max)
self.info("Retrying now...")
else:
raise Exception('Could not connect')
raise Exception("Could not connect")

return resp

Expand Down

0 comments on commit 1f41f82

Please sign in to comment.