refactored usages of iteritems, itervalues, and iterkeys to be 2/3 compliant
This commit is contained in:
parent
8d6bf54a16
commit
1e98175e35
15 changed files with 116 additions and 66 deletions
|
@ -252,8 +252,7 @@ def hex_dump(s, bytes_per_word=2, words_per_line=8):
|
|||
while s:
|
||||
line = s[:total_bytes]
|
||||
s = s[total_bytes:]
|
||||
tmp = map(lambda x: ("%02x" * bytes_per_word) % x,
|
||||
zip(*[iter(map(ord, line))] * bytes_per_word))
|
||||
tmp = map(lambda x: ("%02x" * bytes_per_word) % x, zip(*[iter(map(ord, line))] * bytes_per_word))
|
||||
if len(line) % 2:
|
||||
tmp.append("%x" % ord(line[-1]))
|
||||
dump += "0x%08x: %s\n" % (count, " ".join(tmp))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue