Skip to content
This repository was archived by the owner on Oct 12, 2022. It is now read-only.

Commit 4be57fb

Browse files
Update _async.py
1 parent 01cdd01 commit 4be57fb

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

openrobot/api_wrapper/_async.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,9 +126,9 @@ async def _request(self, method: str, url: str, **kwargs) -> typing.Union[dict,
126126
raise TooManyRequests(resp, js)
127127

128128
try:
129-
await asyncio.sleep(resp.headers['Retry-After'])
129+
await asyncio.sleep(int(resp.headers['Retry-After']))
130130
except KeyError as e:
131-
raise KeyError('Retry-After header is not present.') from e
131+
raise KeyError('Retry-After header is not present.') from e # this probably wont trigger, but either way we still need to handle it, right?
132132

133133
if tries:
134134
tries -= 1
@@ -314,4 +314,4 @@ def translate(self) -> Translate:
314314
@property
315315
def speech(self) -> Speech:
316316
""":class:`Speech`: The Speech client."""
317-
return Speech(self, True)
317+
return Speech(self, True)

0 commit comments

Comments
 (0)