diff options
author | Cory Benfield <lukasaoz@gmail.com> | 2014-12-16 09:19:50 +0000 |
---|---|---|
committer | Cory Benfield <lukasaoz@gmail.com> | 2014-12-16 09:19:50 +0000 |
commit | f723ab538f2cfa52ad25cdacb90d7d91fbdb3f00 (patch) | |
tree | b6625c04cded54643754e29a2cb5f44ab163933f | |
parent | d7c0249aa8d46d1383cb31d38196c7715c213611 (diff) | |
parent | 925e975295e2fe772268e748c6c074af7b0ae47d (diff) | |
download | python-requests-f723ab538f2cfa52ad25cdacb90d7d91fbdb3f00.tar.gz |
Merge pull request #2382 from daftshady/exception
catch exception more specifically
-rw-r--r-- | requests/models.py | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/requests/models.py b/requests/models.py index 2370b67f..17ff4660 100644 --- a/requests/models.py +++ b/requests/models.py @@ -22,9 +22,8 @@ from .packages.urllib3.util import parse_url from .packages.urllib3.exceptions import ( DecodeError, ReadTimeoutError, ProtocolError) from .exceptions import ( - HTTPError, RequestException, MissingSchema, InvalidURL, - ChunkedEncodingError, ContentDecodingError, ConnectionError, - StreamConsumedError) + HTTPError, MissingSchema, InvalidURL, ChunkedEncodingError, + ContentDecodingError, ConnectionError, StreamConsumedError) from .utils import ( guess_filename, get_auth_from_url, requote_uri, stream_decode_response_unicode, to_key_val_list, parse_header_links, @@ -615,7 +614,7 @@ class Response(object): def ok(self): try: self.raise_for_status() - except RequestException: + except HTTPError: return False return True |