mirror of
https://github.com/python/cpython.git
synced 2024-11-25 19:03:49 +08:00
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
Block a user