if connecting to the agent fails, assume it's just not there, and don't raise an exception. (suggestion from martin pool on bazaar-dev.)
This commit is contained in:
parent
bc66f5eed2
commit
db89be96ef
|
@ -58,7 +58,11 @@ class Agent:
|
|||
self.keys = ()
|
||||
if ('SSH_AUTH_SOCK' in os.environ) and (sys.platform != 'win32'):
|
||||
conn = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
|
||||
conn.connect(os.environ['SSH_AUTH_SOCK'])
|
||||
try:
|
||||
conn.connect(os.environ['SSH_AUTH_SOCK'])
|
||||
except:
|
||||
# probably a dangling env var: the ssh agent is gone
|
||||
return
|
||||
self.conn = conn
|
||||
elif sys.platform == 'win32':
|
||||
import win_pageant
|
||||
|
|
Loading…
Reference in New Issue