From c05aa0364280803d8274e260a739553d588ea052 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Thu, 31 Oct 2019 07:42:53 -0600 Subject: 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 --- tools/buildman/board.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'tools/buildman/board.py') diff --git a/tools/buildman/board.py b/tools/buildman/board.py index 2a1d021574c..447aaabea86 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) -- cgit v1.2.3