Skip to content
Myr

Fix raise_for_status()

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

authored by Ian Cordasco · committed by Ian Cordasco · parent 664880d · Browse files · 1 file+5 added−3 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−3 removed

  • other:+5 added−3 removed

1 file+5 added−3 removed

modified:requests/models.py+5 added-3 removed
825 unmodified lines
826827 if self.error:828 raise self.error829830 http_error_msg = ''831 if 300 <= self.status_code < 400 and not allow_redirects:832 http_error_msg = '%s Redirection: %s' % (self.status_code, self.reason)833834 elif 400 <= self.status_code < 500:
1 unmodified line
836837 elif 500 <= self.status_code < 600:838 http_error_msg = '%s Server Error: %s' % (self.status_code, self.reason)839840 if http_error_msg:839 http_error = HTTPError(http_error_msg)840 http_error.response = self841 raise http_error841 http_error = HTTPError(http_error_msg)842 http_error.response = self843 raise http_error