Compatibility fixes (#1616)

* socket.TCP_KEEP* are not defined on windows, macosx, and *bsd
* add [secure] extra to urllib3 for better handling of ip/host checks
This commit is contained in:
Alexander Kukushkin
2020-07-21 08:13:44 +02:00
committed by GitHub
parent a68692a3e4
commit 38f5f464cb
2 changed files with 4 additions and 4 deletions
+3 -3
View File
@@ -488,9 +488,9 @@ def keepalive_socket_options(timeout, idle, cnt=3):
if sys.platform.startswith('linux'):
yield (socket.SOL_TCP, 18, int(timeout * 1000)) # TCP_USER_TIMEOUT
TCP_KEEPIDLE = socket.TCP_KEEPIDLE
TCP_KEEPINTVL = socket.TCP_KEEPINTVL
TCP_KEEPCNT = socket.TCP_KEEPCNT
TCP_KEEPIDLE = getattr(socket, 'TCP_KEEPIDLE', None)
TCP_KEEPINTVL = getattr(socket, 'TCP_KEEPINTVL', None)
TCP_KEEPCNT = getattr(socket, 'TCP_KEEPCNT', None)
elif sys.platform.startswith('darwin'):
TCP_KEEPIDLE = 0x10 # (named "TCP_KEEPALIVE" in C)
TCP_KEEPINTVL = 0x101
+1 -1
View File
@@ -1,4 +1,4 @@
urllib3>=1.19.1,!=1.21
urllib3[secure]>=1.19.1,!=1.21
boto
PyYAML
six >= 1.7