From b45b817e6f31f3dda671f95efdcbb877c791e860 Mon Sep 17 00:00:00 2001 From: Angus Gratton Date: Mon, 12 Apr 2021 17:16:49 +1000 Subject: [PATCH] partition_table: Fix pylint issues in gen_esp32part.py --- components/partition_table/gen_esp32part.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/components/partition_table/gen_esp32part.py b/components/partition_table/gen_esp32part.py index 2011c78970..36efbfb0e3 100755 --- a/components/partition_table/gen_esp32part.py +++ b/components/partition_table/gen_esp32part.py @@ -115,15 +115,15 @@ class PartitionTable(list): @classmethod def from_file(cls, f): - input = f.read() - input_is_binary = input[0:2] == PartitionDefinition.MAGIC_BYTES - if input_is_binary: + data = f.read() + data_is_binary = data[0:2] == PartitionDefinition.MAGIC_BYTES + if data_is_binary: status('Parsing binary partition input...') - return cls.from_binary(input), True - else: - input = input.decode() - status('Parsing CSV input...') - return cls.from_csv(input), False + return cls.from_binary(data), True + + data = data.decode() + status('Parsing CSV input...') + return cls.from_csv(data), False @classmethod def from_csv(cls, csv_contents): @@ -186,7 +186,7 @@ class PartitionTable(list): None if not found """ # convert ptype & subtypes names (if supplied this way) to integer values ptype = get_ptype_as_int(ptype) - subtype = get_subtype_as_int(subtype) + subtype = get_subtype_as_int(ptype, subtype) for p in self: if p.type == ptype and p.subtype == subtype: