(family)
Checks if the family is valid for the current environment.
Checks if the family is valid for the current environment.
Checks if the family is valid for the current environment .
def _validate_family(family):
    '''
    Checks if the family is valid for the current environment.
    '''
    if sys.platform != 'win32' and family == 'AF_PIPE':
        raise ValueError('Family %s is not recognized.' % family)

    if sys.platform == 'win32' and family == 'AF_UNIX':
        # double check
        if not hasattr(socket, family):
            raise ValueError('Family %s is not recognized.' % family)
def _validate_family ( family ) : if sys . platform != 'win32' and family == 'AF_PIPE' : raise ValueError ( 'Family %s is not recognized.' % family ) if sys . platform == 'win32' and family == 'AF_UNIX' : # double check if not hasattr ( socket , family ) : raise ValueError ( 'Family %s is not recognized.' % family )