def quiet_shutdown(socket_instance):
 try:
  socket_instance.shutdown(socket.SHUT_RDWR)
 except Exception:
  logger.debug(u'Exception while shutting down a socket', exc_info=True)

def quiet_shutdown ( socket_instance ) : try : socket_instance . shutdown ( socket . SHUT_RDWR ) except Exception : logger . debug ( u'Exception while shutting down a socket' , exc_info = True )
quietly shuts down a socket without throwing an exception .