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

Commit d0937c5

Browse files
Update _sync.py
1 parent 4be57fb commit d0937c5

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

openrobot/api_wrapper/_sync.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,9 +114,9 @@ def _request(self, method: str, url: str, **kwargs):
114114
raise TooManyRequests(r, js)
115115

116116
try:
117-
time.sleep(r.headers['Retry-After'])
117+
time.sleep(int(resp.headers['Retry-After']))
118118
except KeyError as e:
119-
raise KeyError('Retry-After header is not present.') from e
119+
raise KeyError('Retry-After header is not present.') from e # this probably wont trigger, but either way we still need to handle it, right?
120120

121121
if tries:
122122
tries -= 1
@@ -258,4 +258,4 @@ def translate(self):
258258
@property
259259
def speech(self) -> Speech:
260260
""":class:`Speech`: The Speech client."""
261-
return Speech(self, False)
261+
return Speech(self, False)

0 commit comments

Comments
 (0)