From: Shivani Tipnis Date: Thu, 11 Oct 2018 06:19:32 +0000 (+0530) Subject: nvs_util: Add Python2 and Python3 compatible X-Git-Tag: v3.2-beta1~49^2~3 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1d38d8a17fed8f4ea5d200d5bb8fe0a509aba67b;p=esp-idf nvs_util: Add Python2 and Python3 compatible --- diff --git a/components/nvs_flash/nvs_partition_generator/nvs_partition_gen.py b/components/nvs_flash/nvs_partition_generator/nvs_partition_gen.py index 003d1bab9b..2330c6102b 100755 --- a/components/nvs_flash/nvs_partition_generator/nvs_partition_gen.py +++ b/components/nvs_flash/nvs_partition_generator/nvs_partition_gen.py @@ -207,24 +207,13 @@ class Page(object): if self.is_encrypt: encr_data_ret = self.encrypt_data(data, entrycount,nvs_obj) - if sys.version_info[0] < 3: - encr_data[0:len(encr_data_ret)] = encr_data_ret - else: - encr_data[0:len(encr_data_ret)] = encr_data_ret - + encr_data[0:len(encr_data_ret)] = encr_data_ret data = encr_data data_offset = Page.FIRST_ENTRY_OFFSET + (Page.SINGLE_ENTRY_SIZE * self.entry_num) start_idx = data_offset end_idx = data_offset + len(data) - if not sys.version_info[0] < 3: - if type(data) == str: - self.page_buf[start_idx:end_idx] = data - else: - self.page_buf[start_idx:end_idx] = data - else: - self.page_buf[start_idx:end_idx] = data - + self.page_buf[start_idx:end_idx] = data # Set bitmap array for entries in current page for i in range(0, entrycount):