Skip to content
Myr

Revert "Clarify the contract of Response#ok, and avoid exceptions in it"

Before adoption: this commit came in with the history the project adopted, so no landing records it.

This reverts commit 086e19d8e175cccb630ee3589affdd2f38075ecd.

authored by Cory Benfield · committed by Cory Benfield · parent 086e19d · Browse files · 1 file+5 added−2 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+5 added−2 removed

  • other:+5 added−2 removed

1 file+5 added−2 removed

modified:requests/models.py+5 added-2 removed
614 unmodified lines
615 return self.iter_content(128)616617 @property618 def ok(self):619 """True if the status code does *not* indicate an error, i.e. status code < 400."""620 return self.status_code < 400619 try:620 self.raise_for_status()621 except HTTPError:622 return False623 return True624625 @property626 def is_redirect(self):627 """True if this Response is a well-formed HTTP redirect that could have
221 unmodified lines