summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorTimothy Redaelli <tredaelli@redhat.com>2018-05-31 16:52:40 +0200
committerBen Pfaff <blp@ovn.org>2018-06-14 13:48:41 -0700
commit7c8d6fee1fac1b51a901aadaf35f9cdcf2c4dfb1 (patch)
tree4a8ca3ec42d20b7e5d8b4ca3590d814792d227ec /tests
parentf7979b1181132619ea591f2c9e76fa8c37adeb54 (diff)
downloadopenvswitch-7c8d6fee1fac1b51a901aadaf35f9cdcf2c4dfb1.tar.gz
tests/sendpkt.py: Fix to work with Python3
CC: Ashish Varma <ashishvarma.ovs@gmail.com> Fixes: 296251ca0c82 ("tests: Added NSH related unit test cases for datapath") Signed-off-by: Timothy Redaelli <tredaelli@redhat.com> Acked-by: Ashish Varma <ashishvarma.ovs@gmail.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
Diffstat (limited to 'tests')
-rwxr-xr-xtests/sendpkt.py5
1 files changed, 4 insertions, 1 deletions
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)