diff options
author | Nick Mathewson <nickm@torproject.org> | 2018-07-03 09:48:03 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2018-07-03 09:48:03 -0400 |
commit | a4e8f945077b8eebbbd5be85f89b1631305ce1cc (patch) | |
tree | 32f39e03cd10d4cc10dbe87bc50fb87b10fab325 /src/test | |
parent | e6366f787c49bebd5faafa1b6f78c81ab463fd08 (diff) | |
parent | b205714ba8fd65340e6f282db95663390d5d492e (diff) | |
download | tor-a4e8f945077b8eebbbd5be85f89b1631305ce1cc.tar.gz tor-a4e8f945077b8eebbbd5be85f89b1631305ce1cc.zip |
Merge branch 'maint-0.2.9' into maint-0.3.2
Diffstat (limited to 'src/test')
-rwxr-xr-x | src/test/ntor_ref.py | 9 |
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()) |