BaseTools: use map and filter to replace the itertools function

Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Yunhua Feng <yunhuax.feng@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
This commit is contained in:
Yunhua Feng 2018-07-27 15:53:45 +08:00 committed by Yonghong Zhu
parent 4ce4f757d7
commit fe3991d635
1 changed files with 3 additions and 4 deletions

View File

@ -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")