summaryrefslogtreecommitdiff
path: root/examples/ssh_tunnel.py
diff options
context:
space:
mode:
authorSteven Myint <git@stevenmyint.com>2013-10-04 10:23:57 -0700
committerSteven Myint <git@stevenmyint.com>2013-10-04 10:23:57 -0700
commit178adc68ec0e15fd05cfd2441ee925319028b50f (patch)
tree1c8a97fbde948ca9ea6cc5de90803ba6b8bb062c /examples/ssh_tunnel.py
parenta12cbd428a1efa28092448962c48056f7d914e57 (diff)
downloadpexpect-git-178adc68ec0e15fd05cfd2441ee925319028b50f.tar.gz
Add some Python 3 support
Diffstat (limited to 'examples/ssh_tunnel.py')
-rwxr-xr-xexamples/ssh_tunnel.py7
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: ')