binascii.hexlify returns a bytes object; we must convert it to str

before we can pass it to re.sub.
This commit is contained in:
Thomas Heller 2007-07-12 19:56:28 +00:00
parent 0d8a1fd78d
commit d660fabd24
1 changed files with 1 additions and 1 deletions

View File

@ -6,7 +6,7 @@ import re
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]