コード例 #1
0
ファイル: funcs.py プロジェクト: AirBayCreative/hippyvm
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
コード例 #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
コード例 #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)
コード例 #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)
コード例 #5
0
ファイル: interp_func.py プロジェクト: Mu-L/pypy
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)
コード例 #6
0
ファイル: interp_func.py プロジェクト: mozillazg/pypy
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)