def __init__(self):
        """
        Open a session with the local machine's SSH agent, if one is running.
        If no agent is running, initialization will succeed, but L{get_keys}
        will return an empty tuple.

        @raise SSHException: if an SSH agent is found, but speaks an
            incompatible protocol
        """
        AgentSSH.__init__(self)

        if ('SSH_AUTH_SOCK' in os.environ) and (sys.platform != 'win32'):
            conn = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
            try:
                conn.connect(os.environ['SSH_AUTH_SOCK'])
            except:
                # probably a dangling env var: the ssh agent is gone
                return
        elif sys.platform == 'win32':
            import win_pageant
            if win_pageant.can_talk_to_agent():
                conn = win_pageant.PageantConnection()
            else:
                return
        else:
            # no agent support
            return
        self._connect(conn)
def __init__ ( self ) : AgentSSH . __init__ ( self ) if ( 'SSH_AUTH_SOCK' in os . environ ) and ( sys . platform != 'win32' ) : conn = socket . socket ( socket . AF_UNIX , socket . SOCK_STREAM ) try : conn . connect ( os . environ [ 'SSH_AUTH_SOCK' ] ) except : return elif sys . platform == 'win32' : import win_pageant if win_pageant . can_talk_to_agent ( ) : conn = win_pageant . PageantConnection ( ) else : return else : return self . _connect ( conn )
Open a session with the local machine's SSH agent, if one is running.
        If no agent is running, initialization will succeed, but L{get_keys}
        will return an empty tuple.

        @raise SSHException: if an SSH agent is found, but speaks an
            incompatible protocol