Exemplo n.º 1
0
def inet_ntop(space, address):
    """ Converts a packed internet address
    to a human readable representation"""
    try:
        n = rsocket.inet_ntop(rsocket.AF_INET, address)
        return space.newstr(n)
    except rsocket.RSocketError:
        return space.w_False
Exemplo n.º 2
0
def inet_ntop(space, address):
    """ Converts a packed internet address
    to a human readable representation"""
    try:
        n = rsocket.inet_ntop(rsocket.AF_INET, address)
        return space.newstr(n)
    except rsocket.RSocketError:
        return space.w_False
Exemplo n.º 3
0
def inet_ntop(space, family, packed):
    """inet_ntop(family, packed_ip) -> string formatted IP address

    Convert a packed IP address of the given family to string format.
    """
    try:
        ip = rsocket.inet_ntop(family, packed)
    except SocketError, e:
        raise converted_error(space, e)
Exemplo n.º 4
0
def inet_ntop(space, family, packed):
    """inet_ntop(family, packed_ip) -> string formatted IP address

    Convert a packed IP address of the given family to string format.
    """
    try:
        ip = rsocket.inet_ntop(family, packed)
    except SocketError, e:
        raise converted_error(space, e)
Exemplo n.º 5
0
def inet_ntop(space, family, packed):
    """inet_ntop(family, packed_ip) -> string formatted IP address

    Convert a packed IP address of the given family to string format.
    """
    try:
        ip = rsocket.inet_ntop(family, packed)
    except SocketError as e:
        raise converted_error(space, e)
    except ValueError:
        raise oefmt(space.w_ValueError,
                    "invalid length of packed IP address string")
    return space.newtext(ip)
Exemplo n.º 6
0
def inet_ntop(space, family, packed):
    """inet_ntop(family, packed_ip) -> string formatted IP address

    Convert a packed IP address of the given family to string format.
    """
    try:
        ip = rsocket.inet_ntop(family, packed)
    except SocketError as e:
        raise converted_error(space, e)
    except ValueError:
        raise oefmt(space.w_ValueError,
                    "invalid length of packed IP address string")
    return space.wrap(ip)