Skip to content

Commit

Permalink
add hex prefix to data bytes in string representation of Ext
Browse files Browse the repository at this point in the history
  • Loading branch information
vsergeev committed Oct 19, 2016
1 parent 740ea27 commit 106a217
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions umsgpack.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,13 +117,7 @@ def __str__(self):
String representation of this Ext object.
"""
s = "Ext Object (Type: 0x%02x, Data: " % self.type
for i in range(min(len(self.data), 8)):
if i > 0:
s += " "
if isinstance(self.data[i], int):
s += "%02x" % (self.data[i])
else:
s += "%02x" % ord(self.data[i])
s += " ".join(["0x%02x" % ord(self.data[i:i+1]) for i in xrange(min(len(self.data), 8))])
if len(self.data) > 8:
s += " ..."
s += ")"
Expand Down

0 comments on commit 106a217

Please sign in to comment.