summaryrefslogtreecommitdiff
path: root/tools/binman/bsection.py
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2019-05-14 15:53:47 -0600
committerSimon Glass <sjg@chromium.org>2019-07-10 16:52:58 -0600
commite6d85ff9f239a338748871b93ed11f066609e869 (patch)
tree5add11f4bc83ae9a6c2b9fe57157cb6031ccd16b /tools/binman/bsection.py
parent6d1d6418645229d5de2f8c52bf6a9ce6a345c2a1 (diff)
binman: Handle repeated bytes for Python 3
The method of multiplying a character by a number works well for creating a repeated string in Python 2. But in Python 3 we need to use bytes() instead, to avoid unicode problems, since 'bytes' is no-longer just an alias of 'str'. Create a function to handle this detail and call it from the relevant places in binman. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'tools/binman/bsection.py')
-rw-r--r--tools/binman/bsection.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/binman/bsection.py b/tools/binman/bsection.py
index 3ca0592fe1..03dfa2f805 100644
--- a/tools/binman/bsection.py
+++ b/tools/binman/bsection.py
@@ -332,7 +332,7 @@ class Section(object):
def GetData(self):
"""Get the contents of the section"""
- section_data = chr(self._pad_byte) * self._size
+ section_data = tools.GetBytes(self._pad_byte, self._size)
for entry in self._entries.values():
data = entry.GetData()