diff options
author | Jason R. Coombs <jaraco@jaraco.com> | 2015-05-08 10:34:37 -0400 |
---|---|---|
committer | Jason R. Coombs <jaraco@jaraco.com> | 2015-05-08 10:34:37 -0400 |
commit | 1f262db4040328572565bfdac4b435fd19afaae1 (patch) | |
tree | d8a3a9036ba18a3a0083cbe1e3a85e3dce756c66 /demos/rforward.py | |
parent | f2213b8a40c652780c209071574e4c85a8480eb3 (diff) | |
parent | 7400ce4fd80fc6c0cfc1b3d96900ee2fb87f9ebe (diff) |
Merge with 1.13
Diffstat (limited to 'demos/rforward.py')
-rwxr-xr-x | demos/rforward.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/demos/rforward.py b/demos/rforward.py index ef4c5329..ae70670c 100755 --- a/demos/rforward.py +++ b/demos/rforward.py @@ -9,7 +9,7 @@ # Software Foundation; either version 2.1 of the License, or (at your option) # any later version. # -# Paramiko is distrubuted in the hope that it will be useful, but WITHOUT ANY +# Paramiko is distributed in the hope that it will be useful, but WITHOUT ANY # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR # A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more # details. @@ -46,7 +46,7 @@ def handler(chan, host, port): sock = socket.socket() try: sock.connect((host, port)) - except Exception, e: + except Exception as e: verbose('Forwarding request to %s:%d failed: %r' % (host, port, e)) return @@ -82,7 +82,7 @@ def reverse_forward_tunnel(server_port, remote_host, remote_port, transport): def verbose(s): if g_verbose: - print s + print(s) HELP = """\ @@ -150,8 +150,8 @@ def main(): try: client.connect(server[0], server[1], username=options.user, key_filename=options.keyfile, look_for_keys=options.look_for_keys, password=password) - except Exception, e: - print '*** Failed to connect to %s:%d: %r' % (server[0], server[1], e) + except Exception as e: + print('*** Failed to connect to %s:%d: %r' % (server[0], server[1], e)) sys.exit(1) verbose('Now forwarding remote port %d to %s:%d ...' % (options.port, remote[0], remote[1])) @@ -159,7 +159,7 @@ def main(): try: reverse_forward_tunnel(options.port, remote[0], remote[1], client.get_transport()) except KeyboardInterrupt: - print 'C-c: Port forwarding stopped.' + print('C-c: Port forwarding stopped.') sys.exit(0) |