summaryrefslogtreecommitdiff
path: root/src/test/ntor_ref.py
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2018-07-03 09:48:03 -0400
committerNick Mathewson <nickm@torproject.org>2018-07-03 09:48:03 -0400
commitd38e474950ab41ad3593dc94de9a240f02938679 (patch)
tree22cf451cf2d181bbde0d061e27264431eff90fa7 /src/test/ntor_ref.py
parentcd2be4283c8b4f8543649b067f198e7cf43652c1 (diff)
parent4c094436c50a489d2ecdd09b8dfb7dc9a3c97389 (diff)
downloadtor-d38e474950ab41ad3593dc94de9a240f02938679.tar.gz
tor-d38e474950ab41ad3593dc94de9a240f02938679.zip
Merge branch 'maint-0.3.3' into maint-0.3.4
Diffstat (limited to 'src/test/ntor_ref.py')
-rwxr-xr-xsrc/test/ntor_ref.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/test/ntor_ref.py b/src/test/ntor_ref.py
index c753588f97..51f218f512 100755
--- a/src/test/ntor_ref.py
+++ b/src/test/ntor_ref.py
@@ -336,13 +336,16 @@ def test_tor():
Call the test-ntor-cl command-line program to make sure we can
interoperate with Tor's ntor program
"""
- enhex=lambda s: binascii.b2a_hex(s)
+ if sys.version_info[0] >= 3:
+ enhex=lambda s: binascii.b2a_hex(s).decode("ascii")
+ else:
+ enhex=lambda s: binascii.b2a_hex(s)
dehex=lambda s: binascii.a2b_hex(s.strip())
- PROG = b"./src/test/test-ntor-cl"
+ PROG = "./src/test/test-ntor-cl"
def tor_client1(node_id, pubkey_B):
" returns (msg, state) "
- p = subprocess.Popen([PROG, b"client1", enhex(node_id),
+ p = subprocess.Popen([PROG, "client1", enhex(node_id),
enhex(pubkey_B.serialize())],
stdout=subprocess.PIPE)
return map(dehex, p.stdout.readlines())