mirror of https://github.com/python/cpython
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:
parent
0d8a1fd78d
commit
d660fabd24
|
@ -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]
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue