Make {pf_key,policy_crash}_test pass on both python2 and python3.
Bug: 243057700
Test: tests pass on bramble with both python versions
Change-Id: Iccbc9b7b56391b20aa856952794955abb7323120
diff --git a/net/test/policy_crash_test.py b/net/test/policy_crash_test.py
index ad1b92a..2771475 100755
--- a/net/test/policy_crash_test.py
+++ b/net/test/policy_crash_test.py
@@ -70,6 +70,7 @@
# ----------------------------------------------------------------------
+import binascii
import os
import socket
import unittest
@@ -126,8 +127,8 @@
+ pkt2_frag_payload)
s = socket.socket(socket.AF_INET6, socket.SOCK_RAW, socket.IPPROTO_RAW)
- s.sendto(pkt1.decode('hex'), ('::1', 0))
- s.sendto(pkt2.decode('hex'), ('::1', 0))
+ s.sendto(binascii.unhexlify(pkt1), ('::1', 0))
+ s.sendto(binascii.unhexlify(pkt2), ('::1', 0))
s.close()