Skip to content

Commit

Permalink
tests/sendpkt.py: Fix to work with Python3
Browse files Browse the repository at this point in the history
CC: Ashish Varma <[email protected]>
Fixes: 296251c ("tests: Added NSH related unit test cases for datapath")
Signed-off-by: Timothy Redaelli <[email protected]>
Acked-by: Ashish Varma <[email protected]>
Signed-off-by: Ben Pfaff <[email protected]>
  • Loading branch information
drizzt authored and blp committed Jun 14, 2018
1 parent f7979b1 commit 7c8d6fe
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tests/sendpkt.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,10 @@

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)
Expand Down

0 comments on commit 7c8d6fe

Please sign in to comment.