diff options
author | SVN-Git Migration <python-modules-team@lists.alioth.debian.org> | 2015-10-08 13:19:39 -0700 |
---|---|---|
committer | SVN-Git Migration <python-modules-team@lists.alioth.debian.org> | 2015-10-08 13:19:39 -0700 |
commit | 54bdd56778a37ea9d56d451d4ae49b99cbbfceaa (patch) | |
tree | 3b69a7371b29898f08ced7514b42bad8afdc8759 /urllib3/util/connection.py | |
parent | 0f393d00b51bc54c5075447e4a8b21f0bed6acd8 (diff) | |
download | python-urllib3-54bdd56778a37ea9d56d451d4ae49b99cbbfceaa.tar python-urllib3-54bdd56778a37ea9d56d451d4ae49b99cbbfceaa.tar.gz |
Imported Upstream version 1.9.1
Diffstat (limited to 'urllib3/util/connection.py')
-rw-r--r-- | urllib3/util/connection.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/urllib3/util/connection.py b/urllib3/util/connection.py index 062ee9d..2156993 100644 --- a/urllib3/util/connection.py +++ b/urllib3/util/connection.py @@ -66,13 +66,15 @@ def create_connection(address, timeout=socket._GLOBAL_DEFAULT_TIMEOUT, sock = None try: sock = socket.socket(af, socktype, proto) + + # If provided, set socket level options before connecting. + # This is the only addition urllib3 makes to this function. + _set_socket_options(sock, socket_options) + if timeout is not socket._GLOBAL_DEFAULT_TIMEOUT: sock.settimeout(timeout) if source_address: sock.bind(source_address) - # If provided, set socket level options before connecting. - # This is the only addition urllib3 makes to this function. - _set_socket_options(sock, socket_options) sock.connect(sa) return sock |