Commit 98df1bc
Fix Retry-After header never parsed on non-2xx responses
requests.Response.__bool__() returns False for non-2xx status codes.
The checks `if e.response` and `if response` evaluated to False for
429 responses, so parse_retry_after() was never called and the SDK
fell back to normal backoff instead of respecting Retry-After.
Changed both checks to explicit `is not None` comparisons.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>1 parent 2474b46 commit 98df1bc
1 file changed
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
78 | 78 | | |
79 | 79 | | |
80 | 80 | | |
81 | | - | |
| 81 | + | |
82 | 82 | | |
83 | 83 | | |
84 | 84 | | |
| |||
257 | 257 | | |
258 | 258 | | |
259 | 259 | | |
260 | | - | |
| 260 | + | |
261 | 261 | | |
262 | 262 | | |
263 | 263 | | |
| |||
0 commit comments