Skip to content

Commit

Permalink
Fixed response code check in Result class
Browse files Browse the repository at this point in the history
  • Loading branch information
Jakub Smolar committed Dec 22, 2023
1 parent c05ddef commit fa7050d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion testsuite/httpx/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def __init__(self, retry_codes, response=None, error=None):

def should_backoff(self):
"""True, if the Result can be considered an instability and should be retried"""
return self.has_dns_error() or (self.error is None and self.status_code in self.retry_codes)
return self.has_dns_error() or (self.error is None and self.response.status_code in self.retry_codes)

def has_error(self, error_msg: str) -> bool:
"""True, if the request failed and an error with message was returned"""
Expand Down

0 comments on commit fa7050d

Please sign in to comment.