[Tarantool-patches] [PATCH 3/4] test: make convert to hex compatible with Python 3.x

sergeyb at tarantool.org sergeyb at tarantool.org
Fri Dec 11 11:42:23 MSK 2020


From: Sergey Bronnikov <sergeyb at tarantool.org>

Part of #5538
---
 test/box-py/iproto.test.py | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/test/box-py/iproto.test.py b/test/box-py/iproto.test.py
index 25ead43c4..72400923c 100644
--- a/test/box-py/iproto.test.py
+++ b/test/box-py/iproto.test.py
@@ -191,7 +191,11 @@ for test in TESTS:
     print("STR", size)
     print("--")
     for fmt in it:
-        print("0x" + fmt.encode("hex"), "=>", end=" ")
+        try:
+            # Python 3
+            print("0x" + "hex".encode("utf-8").hex(), "=>", end=" ")
+        except AttributeError:
+            print("0x" + fmt.encode("hex"), "=>", end=" ")
         field = "*" * size
         c._send_request(RawInsert(c, space_id, "\x91" + fmt + field))
         tuple = space.select(field)[0]
-- 
2.25.1



More information about the Tarantool-patches mailing list