@@ -49,7 +49,7 @@ def hex_dump(src, start_addr=0):
4949 num_spaces = (start_addr % length )
5050 num_chars = length - (start_addr % length )
5151
52- spaces = " " .join ([" " for i in xrange (num_spaces )])
52+ spaces = " " .join ([" " for i in range (num_spaces )])
5353 s = src [0 :num_chars ]
5454 hexa = ' ' .join (["{:02X}" .format (ord (x )) for x in s ])
5555 printable = s .translate (FILTER )
@@ -61,7 +61,7 @@ def hex_dump(src, start_addr=0):
6161 src = src [num_chars :]
6262 remainder_start_addr = base_addr + length
6363
64- for i in xrange (0 , len (src ), length ):
64+ for i in range (0 , len (src ), length ):
6565 s = src [i :i + length ]
6666 hexa = ' ' .join (["{:02X}" .format (ord (x )) for x in s ])
6767 printable = s .translate (FILTER )
@@ -105,7 +105,7 @@ def __call__(self, *args, **kw):
105105 cache = obj .__cache
106106 except AttributeError :
107107 cache = obj .__cache = {}
108- key = (self .func , args [1 :], frozenset (kw .items ()))
108+ key = (self .func , args [1 :], frozenset (list ( kw .items () )))
109109 if key not in cache :
110110 cache [key ] = self .func (* args , ** kw )
111111 return cache [key ]
@@ -229,10 +229,10 @@ def __repr__(self):
229229 return "Block(buf={!r}, offset={!r})" .format (self ._buf , self ._offset )
230230
231231 def __unicode__ (self ):
232- return u "BLOCK @ {}." .format (hex (self .offset ()))
232+ return "BLOCK @ {}." .format (hex (self .offset ()))
233233
234234 def __str__ (self ):
235- return str (unicode ( self ) )
235+ return str (self )
236236
237237 def declare_field (self , type , name , offset = None , length = None ):
238238 """
0 commit comments