def getConnectError(e):
    """Given a socket exception, return connection error."""
    try:
        number, string = e
    except __HOLE__:
        return ConnectError(string=e)

    if hasattr(socket, 'gaierror') and isinstance(e, socket.gaierror):
        # only works in 2.2
        klass = UnknownHostError
    else:
        klass = errnoMapping.get(number, ConnectError)
    return klass(number, string)
dataset/ETHPy150Open nlloyd/SubliminalCollaborator/libs/twisted/internet/error.py/getConnectError