binascii.hexlify returns a bytes object; we must convert it to str
before we can pass it to re.sub.
diff --git a/Lib/ctypes/test/test_array_in_pointer.py b/Lib/ctypes/test/test_array_in_pointer.py
index 3ed310c..0b46fb9 100644
--- a/Lib/ctypes/test/test_array_in_pointer.py
+++ b/Lib/ctypes/test/test_array_in_pointer.py
@@ -6,7 +6,7 @@
 def dump(obj):
     # helper function to dump memory contents in hex, with a hyphen
     # between the bytes.
-    h = hexlify(buffer(obj))
+    h = str(hexlify(buffer(obj)))
     return re.sub(r"(..)", r"\1-", h)[:-1]