partition_table: Fix encoding for Python 2.7.3

struct.pack can handle Unicode argument in latest Python 2.7 but cannot
(at least) in 2.7.3.
This commit is contained in:
Roland Dobai 2018-09-20 12:01:54 +02:00
parent 593abe0768
commit 4465dc29bb

View File

@ -355,7 +355,7 @@ class PartitionDefinition(object):
if self.name in all_subtype_names and SUBTYPES.get(self.type, {}).get(self.name, "") != self.subtype:
critical("WARNING: Partition has name '%s' which is a partition subtype, but this partition has non-matching type 0x%x and subtype 0x%x. Mistake in partition table?" % (self.name, self.type, self.subtype))
STRUCT_FORMAT = "<2sBBLL16sL"
STRUCT_FORMAT = b"<2sBBLL16sL"
@classmethod
def from_binary(cls, b):