From fe3991d63552f2eb25ff728a81a6976a3b1f652b Mon Sep 17 00:00:00 2001 From: Yunhua Feng Date: Fri, 27 Jul 2018 15:53:45 +0800 Subject: [PATCH] BaseTools: use map and filter to replace the itertools function Cc: Liming Gao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Yunhua Feng Reviewed-by: Liming Gao --- BaseTools/Source/Python/build/build.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/BaseTools/Source/Python/build/build.py b/BaseTools/Source/Python/build/build.py index 7715cfa52a..2629d6046d 100644 --- a/BaseTools/Source/Python/build/build.py +++ b/BaseTools/Source/Python/build/build.py @@ -25,7 +25,6 @@ import time import platform import traceback import encodings.ascii -import itertools import multiprocessing from struct import * @@ -1172,9 +1171,9 @@ class Build(): f = open(PrebuildEnvFile) envs = f.readlines() f.close() - envs = itertools.imap(lambda l: l.split('=', 1), envs) - envs = itertools.ifilter(lambda l: len(l) == 2, envs) - envs = itertools.imap(lambda l: [i.strip() for i in l], envs) + envs = map(lambda l: l.split('=', 1), envs) + envs = filter(lambda l: len(l) == 2, envs) + envs = map(lambda l: [i.strip() for i in l], envs) os.environ.update(dict(envs)) EdkLogger.info("\n- Prebuild Done -\n") -- 2.39.5