diff options
author | noah <noah@656d521f-e311-0410-88e0-e7920216d269> | 2004-03-01 21:11:34 +0000 |
---|---|---|
committer | noah <noah@656d521f-e311-0410-88e0-e7920216d269> | 2004-03-01 21:11:34 +0000 |
commit | 3f0ca36375a04b52bf396402ada8836d9c6854e0 (patch) | |
tree | ab8fa2796a62a95f4a384911a230d4d2cd0e99ba | |
parent | f5cc4590d6b6813204129ec4c811ede7da4b0cec (diff) | |
download | pexpect-3f0ca36375a04b52bf396402ada8836d9c6854e0.tar.gz |
Yes!
git-svn-id: http://pexpect.svn.sourceforge.net/svnroot/pexpect/trunk@213 656d521f-e311-0410-88e0-e7920216d269
-rw-r--r-- | pexpect/examples/ssh_tunnel.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/pexpect/examples/ssh_tunnel.py b/pexpect/examples/ssh_tunnel.py index 471a886..1147bb7 100644 --- a/pexpect/examples/ssh_tunnel.py +++ b/pexpect/examples/ssh_tunnel.py @@ -12,7 +12,11 @@ X = getpass.getpass('Password: ') def start_tunnel (): ssh_tunnel = pexpect.spawn (tunnel_command % globals()) - ssh_tunnel.expect ('password:') + try: + ssh_tunnel.expect ('password:') + except: + print ssh_tunnel.before + print ssh_tunnel.after time.sleep (0.1) ssh_tunnel.sendline (X) time.sleep (60) |