Skip to content

Commit

Permalink
tcprtt: fix compatibility for python3
Browse files Browse the repository at this point in the history
Suggested by Yonghong, tcprtt report error on python3:
    TypeError: can't concat str to bytes

Both python2 and python3, inet_ntop returns a string type, there is
no need to encode any more.

Test for python2 and python3, both work fine.

Signed-off-by: zhenwei pi <[email protected]>
  • Loading branch information
pizhenwei authored and yonghong-song committed Jun 23, 2021
1 parent 5057944 commit dcef7bc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tools/tcprtt.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@
def print_section(addr):
addrstr = "*******"
if (addr):
addrstr = inet_ntop(AF_INET, struct.pack("I", addr)).encode()
addrstr = inet_ntop(AF_INET, struct.pack("I", addr))

avglat = ""
if args.extension:
Expand Down

0 comments on commit dcef7bc

Please sign in to comment.