aboutsummaryrefslogtreecommitdiff
path: root/tools/buildman/board.py
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2019-10-31 07:42:53 -0600
committerSimon Glass <sjg@chromium.org>2019-11-04 18:15:32 -0700
commitc05aa0364280803d8274e260a739553d588ea052 (patch)
treef062c1f649d6ab5b6c1dab1c349efe81c9a4158a /tools/buildman/board.py
parente3986d9b40f3e52217dea4c47f65e44e549c9ee2 (diff)
downloadu-boot-c05aa0364280803d8274e260a739553d588ea052.zip
u-boot-c05aa0364280803d8274e260a739553d588ea052.tar.gz
u-boot-c05aa0364280803d8274e260a739553d588ea052.tar.bz2
buildman: Convert to Python 3
Convert buildman to Python 3 and make it use that, to meet the 2020 deadline. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'tools/buildman/board.py')
-rw-r--r--tools/buildman/board.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/tools/buildman/board.py b/tools/buildman/board.py
index 2a1d021..447aaab 100644
--- a/tools/buildman/board.py
+++ b/tools/buildman/board.py
@@ -1,6 +1,7 @@
# SPDX-License-Identifier: GPL-2.0+
# Copyright (c) 2012 The Chromium OS Authors.
+from collections import OrderedDict
import re
class Expr:
@@ -120,7 +121,7 @@ class Boards:
Args:
fname: Filename of boards.cfg file
"""
- with open(fname, 'r') as fd:
+ with open(fname, 'r', encoding='utf-8') as fd:
for line in fd:
if line[0] == '#':
continue
@@ -155,7 +156,7 @@ class Boards:
key is board.target
value is board
"""
- board_dict = {}
+ board_dict = OrderedDict()
for board in self._boards:
board_dict[board.target] = board
return board_dict
@@ -166,7 +167,7 @@ class Boards:
Returns:
List of Board objects that are marked selected
"""
- board_dict = {}
+ board_dict = OrderedDict()
for board in self._boards:
if board.build_it:
board_dict[board.target] = board
@@ -259,7 +260,7 @@ class Boards:
due to each argument, arranged by argument.
List of errors found
"""
- result = {}
+ result = OrderedDict()
warnings = []
terms = self._BuildTerms(args)