mirror of
https://github.com/brain-hackers/u-boot-brain
synced 2024-06-09 23:36:03 +09:00
dtoc: binman: Drop Python 2 code
Drop a few more Python 2 relics that are no-longer needed. Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
parent
5c53da2b30
commit
9fc6ebd8fe
|
@ -53,8 +53,8 @@ FmapArea = collections.namedtuple('FmapArea', FMAP_AREA_NAMES)
|
||||||
|
|
||||||
|
|
||||||
def NameToFmap(name):
|
def NameToFmap(name):
|
||||||
if type(name) == bytes and sys.version_info[0] >= 3:
|
if type(name) == bytes:
|
||||||
name = name.decode('utf-8') # pragma: no cover (for Python 2)
|
name = name.decode('utf-8')
|
||||||
return name.replace('\0', '').replace('-', '_').upper()
|
return name.replace('\0', '').replace('-', '_').upper()
|
||||||
|
|
||||||
def ConvertName(field_names, fields):
|
def ConvertName(field_names, fields):
|
||||||
|
|
|
@ -460,8 +460,7 @@ class Node:
|
||||||
prop_name: Name of property to add
|
prop_name: Name of property to add
|
||||||
val: String value of property
|
val: String value of property
|
||||||
"""
|
"""
|
||||||
if sys.version_info[0] >= 3: # pragma: no cover
|
val = bytes(val, 'utf-8')
|
||||||
val = bytes(val, 'utf-8')
|
|
||||||
self.AddData(prop_name, val + b'\0')
|
self.AddData(prop_name, val + b'\0')
|
||||||
|
|
||||||
def AddSubnode(self, name):
|
def AddSubnode(self, name):
|
||||||
|
|
Loading…
Reference in New Issue
Block a user