Skip to content
Snippets Groups Projects
Commit 9eb6987215d6 authored by Robey Pointer's avatar Robey Pointer
Browse files

oops. fix potential exception when there's no ssh agent available.

parent 93f469a34649
Branches
No related tags found
No related merge requests found
......@@ -55,6 +55,7 @@
@raise SSHException: if an SSH agent is found, but speaks an
incompatible protocol
"""
self.conn = None
self.keys = ()
if ('SSH_AUTH_SOCK' in os.environ) and (sys.platform != 'win32'):
conn = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
......@@ -87,6 +88,7 @@
"""
Close the SSH agent connection.
"""
if self.conn is not None:
self.conn.close()
self.conn = None
self.keys = ()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment