def try_ipv6_socket():
 if (not socket.has_ipv6):
  return False
 try:
  socket.socket(socket.AF_INET6).close()
  return True
 except IOError as error:
  logger.debug(u'Platform supports IPv6, but socket creation failed, disabling: %s', encoding.locale_decode(error))
 return False

def try_ipv6_socket ( ) : if ( not socket . has_ipv6 ) : return False try : socket . socket ( socket . AF_INET6 ) . close ( ) return True except IOError as error : logger . debug ( u'Platform supports IPv6, but socket creation failed, disabling: %s' , encoding . locale_decode ( error ) ) return False
determine if system really supports ipv6 .