From 7c8d6fee1fac1b51a901aadaf35f9cdcf2c4dfb1 Mon Sep 17 00:00:00 2001 From: Timothy Redaelli Date: Thu, 31 May 2018 16:52:40 +0200 Subject: [PATCH] tests/sendpkt.py: Fix to work with Python3 CC: Ashish Varma Fixes: 296251ca0c82 ("tests: Added NSH related unit test cases for datapath") Signed-off-by: Timothy Redaelli Acked-by: Ashish Varma Signed-off-by: Ben Pfaff --- tests/sendpkt.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/sendpkt.py b/tests/sendpkt.py index 50a4795eb..328ae2bc9 100755 --- a/tests/sendpkt.py +++ b/tests/sendpkt.py @@ -66,7 +66,10 @@ for a in args[1:]: hex_list.append(temp) -pkt = "".join(map(chr, hex_list)) +if sys.version_info < (3, 0): + pkt = "".join(map(chr, hex_list)) +else: + pkt = bytes(hex_list) try: sockfd = socket.socket(socket.AF_PACKET, socket.SOCK_RAW)