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(
            'Platform supports IPv6, but socket creation failed, '
            'disabling: %s',
            encoding.locale_decode(error))
    return False


#: Boolean value that indicates if creating an IPv6 socket will succeed.
Determine if system really supports IPv6
dataset/ETHPy150Open mopidy/mopidy/mopidy/internal/network.py/try_ipv6_socket