Kaydet (Commit) 537b4681 authored tarafından Ben Firshman's avatar Ben Firshman

Fix attaching with UNIX sockets

Signed-off-by: 's avatarBen Firshman <ben@firshman.co.uk>
üst 721edfd5
......@@ -262,7 +262,16 @@ class Client(requests.Session):
sock = response.raw._fp.fp.raw._sock
else:
sock = response.raw._fp.fp._sock
sock._response = response
try:
# Keep a reference to the response to stop it being garbage
# collected. If the response is garbage collected, it will close
# TLS sockets.
sock._response = response
except AttributeError:
# UNIX sockets can't have attributes set on them, but that's fine
# because we won't be doing TLS over them
pass
return sock
def _stream_helper(self, response):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment