diff options
author | cclauss <cclauss@me.com> | 2020-01-28 01:38:54 +0100 |
---|---|---|
committer | cclauss <cclauss@me.com> | 2020-01-28 01:38:54 +0100 |
commit | 3208a74f906c116e93074c6ed0559df1cbfe58d1 (patch) | |
tree | c43d03841d5c29d4a8fc29793ef71eebc065d989 /contrib | |
parent | aba31e2187808257b250bf469895330f273d7746 (diff) | |
download | tor-3208a74f906c116e93074c6ed0559df1cbfe58d1.tar.gz tor-3208a74f906c116e93074c6ed0559df1cbfe58d1.zip |
Use print() function in both Python 2 and Python 3
Diffstat (limited to 'contrib')
-rwxr-xr-x | contrib/client-tools/tor-resolve.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/contrib/client-tools/tor-resolve.py b/contrib/client-tools/tor-resolve.py index 593efc97d4..3562193715 100755 --- a/contrib/client-tools/tor-resolve.py +++ b/contrib/client-tools/tor-resolve.py @@ -87,7 +87,7 @@ def parseHostAndPort(h): try: port = int(h[i+1:]) except ValueError: - print "Bad hostname %r"%h + print("Bad hostname %r"%h) sys.exit(1) elif h: try: @@ -123,15 +123,15 @@ def resolve(hostname, sockshost, socksport, socksver=4, reverse=0): return None answer += more result = parse(answer) - print "Got answer",result + print("Got answer",result) m = s.recv(1) if m: - print "Got extra data too: %r"%m + print("Got extra data too: %r"%m) return result if __name__ == '__main__': if len(sys.argv) not in (2,3,4): - print "Syntax: resolve.py [-4|-5] hostname [sockshost:socksport]" + print("Syntax: resolve.py [-4|-5] hostname [sockshost:socksport]") sys.exit(0) socksver = 4 reverse = 0 @@ -146,7 +146,7 @@ if __name__ == '__main__': break if len(sys.argv) >= 4: - print "Syntax: resolve.py [-x] [-4|-5] hostname [sockshost:socksport]" + print("Syntax: resolve.py [-x] [-4|-5] hostname [sockshost:socksport]") sys.exit(0) if len(sys.argv) == 3: sh,sp = parseHostAndPort(sys.argv[2]) |