]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
dtoc: binman: Drop Python 2 code
authorSimon Glass <sjg@chromium.org>
Thu, 7 Jan 2021 04:35:10 +0000 (21:35 -0700)
committerSimon Glass <sjg@chromium.org>
Sat, 30 Jan 2021 21:25:41 +0000 (14:25 -0700)
Drop a few more Python 2 relics that are no-longer needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
tools/binman/fmap_util.py
tools/dtoc/fdt.py

index b03fc28fbb492d6ee0672a10701e64d6ab4c26ff..8277619768c7f7e2017ab33ec569b6bdff3813b5 100644 (file)
@@ -53,8 +53,8 @@ FmapArea = collections.namedtuple('FmapArea', FMAP_AREA_NAMES)
 
 
 def NameToFmap(name):
-    if type(name) == bytes and sys.version_info[0] >= 3:
-        name = name.decode('utf-8')  # pragma: no cover (for Python 2)
+    if type(name) == bytes:
+        name = name.decode('utf-8')
     return name.replace('\0', '').replace('-', '_').upper()
 
 def ConvertName(field_names, fields):
index 4a78c73725229e74d06339bcc53ff0a8f39fbce2..965106a3b28a294eca849443273bea8290c9c90a 100644 (file)
@@ -460,8 +460,7 @@ class Node:
             prop_name: Name of property to add
             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')
 
     def AddSubnode(self, name):