summaryrefslogtreecommitdiff
path: root/src
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
commit228d25ddf641f02a38e1cd6386d7e603b9478a9d (patch)
tree1cce531c6bdf732aad142d1627245c3008c47276 /src
parenta9628c0c0b2cc5c0286c4e49591b3b18dc054e87 (diff)
parentd38e474950ab41ad3593dc94de9a240f02938679 (diff)
downloadtor-228d25ddf641f02a38e1cd6386d7e603b9478a9d.tar.gz
tor-228d25ddf641f02a38e1cd6386d7e603b9478a9d.zip
Merge branch 'maint-0.3.4'
Diffstat (limited to 'src')
-rw-r--r--src/test/hs_ntor_ref.py7
-rwxr-xr-xsrc/test/ntor_ref.py9
2 files changed, 11 insertions, 5 deletions
diff --git a/src/test/hs_ntor_ref.py b/src/test/hs_ntor_ref.py
index f892cd8f84..0c5756ad73 100644
--- a/src/test/hs_ntor_ref.py
+++ b/src/test/hs_ntor_ref.py
@@ -234,8 +234,11 @@ Utilities for communicating with the little-t-tor ntor wrapper to conduct the
integration tests
"""
-PROG = b"./src/test/test-hs-ntor-cl"
-enhex=lambda s: binascii.b2a_hex(s)
+PROG = "./src/test/test-hs-ntor-cl"
+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())
def tor_client1(intro_auth_pubkey_str, intro_enc_pubkey,
diff --git a/src/test/ntor_ref.py b/src/test/ntor_ref.py
index 9294827e13..56e97ece36 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())