Converting to immutable hashable types

This commit is contained in:
Juan Leni 2017-10-10 20:59:17 +02:00
parent c4083bb3d1
commit 08334f0908
2 changed files with 2 additions and 2 deletions

View File

@ -181,7 +181,7 @@ def ReadTag(buffer, pos):
while six.indexbytes(buffer, pos) & 0x80:
pos += 1
pos += 1
return (buffer[start:pos], pos)
return (six.binary_type(buffer[start:pos]), pos)
# --------------------------------------------------------------------

View File

@ -418,7 +418,7 @@ def _VarintBytes(value):
def TagBytes(field_number, wire_type):
"""Encode the given tag and return the bytes. Only called at startup."""
return _VarintBytes(wire_format.PackTag(field_number, wire_type))
return six.binary_type( _VarintBytes(wire_format.PackTag(field_number, wire_type)) )
# --------------------------------------------------------------------
# As with sizers (see above), we have a number of common encoder