File tree Expand file tree Collapse file tree 1 file changed +7
-12
lines changed
Expand file tree Collapse file tree 1 file changed +7
-12
lines changed Original file line number Diff line number Diff line change 1- import errno
1+ import logging
22import socket
33import struct
44
1919
2020
2121class TcpConnection (object ):
22- # These are set in the TcpTransport initializer
23- _address = None
24- _timeout = None
25- _socket_keepalive = None
26- _socket_tcp_options = None
27-
2822 """
2923 Connection-related methods for TcpTransport.
3024 """
@@ -228,10 +222,11 @@ def close(self):
228222 # shutdown() method due to the SSL lib
229223 try :
230224 self ._socket .shutdown (socket .SHUT_RDWR )
231- except IOError as e :
232- # NB: sometimes this is the exception if the initial
233- # connection didn't succeed correctly
234- if e .errno != errno .EBADF :
235- raise
225+ except EnvironmentError :
226+ # NB: sometimes these exceptions are raised if the initial
227+ # connection didn't succeed correctly, or if shutdown() is
228+ # called after the connection dies
229+ logging .debug ('Exception occurred while shutting '
230+ 'down socket.' , exc_info = True )
236231 self ._socket .close ()
237232 del self ._socket
You can’t perform that action at this time.
0 commit comments