From dca5ac78f06d2513be4c594bd074f2696603b600 Mon Sep 17 00:00:00 2001 From: Shivani Tipnis Date: Thu, 11 Oct 2018 11:49:32 +0530 Subject: [PATCH] nvs_util: Add Python2 and Python3 compatible --- .../nvs_partition_gen.py | 171 +++++------------- 1 file changed, 50 insertions(+), 121 deletions(-) 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 2b11877ca7..2330c6102b 100755 --- a/components/nvs_flash/nvs_partition_generator/nvs_partition_gen.py +++ b/components/nvs_flash/nvs_partition_generator/nvs_partition_gen.py @@ -17,8 +17,11 @@ # See the License for the specific language governing permissions and # limitations under the License. # -from __future__ import division -from __future__ import print_function + +from __future__ import division, print_function #, unicode_literals +from future.utils import raise_ +from builtins import int, range +from io import open import sys import argparse import binascii @@ -80,7 +83,7 @@ class Page(object): global page_header # set page state to active - page_header= bytearray(b'\xff')*32 + page_header= bytearray(b'\xff') *32 page_state_active_seq = Page.ACTIVE struct.pack_into('