diff options
author | Steven Myint <git@stevenmyint.com> | 2013-10-04 10:23:57 -0700 |
---|---|---|
committer | Steven Myint <git@stevenmyint.com> | 2013-10-04 10:23:57 -0700 |
commit | 178adc68ec0e15fd05cfd2441ee925319028b50f (patch) | |
tree | 1c8a97fbde948ca9ea6cc5de90803ba6b8bb062c /examples/ssh_tunnel.py | |
parent | a12cbd428a1efa28092448962c48056f7d914e57 (diff) | |
download | pexpect-git-178adc68ec0e15fd05cfd2441ee925319028b50f.tar.gz |
Add some Python 3 support
Diffstat (limited to 'examples/ssh_tunnel.py')
-rwxr-xr-x | examples/ssh_tunnel.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/examples/ssh_tunnel.py b/examples/ssh_tunnel.py index 03a2e85..d761911 100755 --- a/examples/ssh_tunnel.py +++ b/examples/ssh_tunnel.py @@ -40,6 +40,13 @@ import pexpect import getpass import time + +try: + raw_input +except NameError: + raw_input = input + + # SMTP:25 IMAP4:143 POP3:110 tunnel_command = 'ssh -C -N -f -L 25:127.0.0.1:25 -L 143:127.0.0.1:143 -L 110:127.0.0.1:110 %(user)@%(host)' host = raw_input('Hostname: ') |