refactored usages of iteritems, itervalues, and iterkeys to be 2/3 compliant

This commit is contained in:
bharnden 2019-05-05 21:23:43 -07:00
parent 8d6bf54a16
commit 1e98175e35
15 changed files with 116 additions and 66 deletions

View file

@ -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))