From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtpng3.m.smailru.net (smtpng3.m.smailru.net [94.100.177.149]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id 2AAF345C304 for ; Fri, 11 Dec 2020 11:43:44 +0300 (MSK) From: sergeyb@tarantool.org Date: Fri, 11 Dec 2020 11:42:23 +0300 Message-Id: In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [Tarantool-patches] [PATCH 3/4] test: make convert to hex compatible with Python 3.x List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: tarantool-patches@dev.tarantool.org, v.shpilevoy@tarantool.org, imun@tarantool.org Cc: alexander.turenko@tarantool.org From: Sergey Bronnikov 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