]> granicus.if.org Git - esp-idf/commitdiff
app_update: Make gen_empty_partition.py Python 2 & 3 compatible
authorRoland Dobai <dobai.roland@gmail.com>
Mon, 24 Sep 2018 06:09:52 +0000 (08:09 +0200)
committerRoland Dobai <dobai.roland@gmail.com>
Mon, 24 Sep 2018 10:16:16 +0000 (12:16 +0200)
Closes https://github.com/espressif/esp-idf/issues/2457

components/app_update/gen_empty_partition.py

index f51df224032381abbcde98bf6e1065a9539aec6b..365b2ada3c0e544a2c0b4715e6afbfc59cdbbf5a 100755 (executable)
@@ -18,6 +18,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 from __future__ import print_function, division
+from __future__ import unicode_literals
 import argparse
 import os
 import re
@@ -42,9 +43,7 @@ def critical(msg):
         sys.stderr.write('\n')
 
 def generate_blanked_file(size, output_path):
-    output = ""
-    for i in range(size):
-        output += b"\xFF"
+    output = b"\xFF" * size
     try:
         stdout_binary = sys.stdout.buffer  # Python 3
     except AttributeError: