Skip to content
Myr

NewConnectionErrors aren't timeouts.

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

This is a compatibility change, and should be removed in 2.8.0

authored by Cory Benfield · committed by Cory Benfield · parent e499b35 · Browse files · 1 file+4 added−1 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+4 added−1 removed

  • other:+4 added−1 removed

1 file+4 added−1 removed

modified:requests/adapters.py+4 added-1 removed
22 unmodified lines
23from .packages.urllib3.exceptions import ClosedPoolError24from .packages.urllib3.exceptions import ConnectTimeoutError25from .packages.urllib3.exceptions import HTTPError as _HTTPError26from .packages.urllib3.exceptions import MaxRetryError27from .packages.urllib3.exceptions import NewConnectionError28from .packages.urllib3.exceptions import ProxyError as _ProxyError29from .packages.urllib3.exceptions import ProtocolError30from .packages.urllib3.exceptions import ReadTimeoutError31from .packages.urllib3.exceptions import SSLError as _SSLError
380 unmodified lines
412 raise ConnectionError(err, request=request)413414 except MaxRetryError as e:415 if isinstance(e.reason, ConnectTimeoutError):416 # TODO: Remove this in 3.0.0: see #2811417 if not isinstance(e.reason, NewConnectionError):415 raise ConnectTimeout(e, request=request)418 raise ConnectTimeout(e, request=request)419420 if isinstance(e.reason, ResponseError):421 raise RetryError(e, request=request)422
17 unmodified lines