Skip to content
Myr

catch exception more specifically in Response.ok

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

authored by daftshady · committed by daftshady · parent d7c0249 · Browse files · 1 file+3 added−4 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+3 added−4 removed

  • other:+3 added−4 removed

1 file+3 added−4 removed

modified:requests/models.py+3 added-4 removed
20 unmodified lines
21from .packages.urllib3.util import parse_url22from .packages.urllib3.exceptions import (23 DecodeError, ReadTimeoutError, ProtocolError)24from .exceptions import (25 HTTPError, RequestException, MissingSchema, InvalidURL, 26 ChunkedEncodingError, ContentDecodingError, ConnectionError, 27 StreamConsumedError)25 HTTPError, MissingSchema, InvalidURL, ChunkedEncodingError,26 ContentDecodingError, ConnectionError, StreamConsumedError)27from .utils import (28 guess_filename, get_auth_from_url, requote_uri,29 stream_decode_response_unicode, to_key_val_list, parse_header_links,30 iter_slices, guess_json_utf, super_len, to_native_string)
582 unmodified lines
613 @property614 def ok(self):615 try:616 self.raise_for_status()618 except RequestException:617 except HTTPError:618 return False619 return True620621 @property
215 unmodified lines