From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=134.134.136.20; helo=mga02.intel.com; envelope-from=bob.c.feng@intel.com; receiver=edk2-devel@lists.01.org Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id EB32B2194D387 for ; Mon, 28 Jan 2019 18:06:23 -0800 (PST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 28 Jan 2019 18:06:23 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,535,1539673200"; d="scan'208";a="295229730" Received: from shwdepsi1121.ccr.corp.intel.com ([10.239.158.47]) by orsmga005.jf.intel.com with ESMTP; 28 Jan 2019 18:06:21 -0800 From: "Feng, Bob C" To: edk2-devel@lists.01.org Cc: Zhijux Fan , Bob Feng , Liming Gao , Yonghong Zhu Date: Tue, 29 Jan 2019 10:05:39 +0800 Message-Id: <20190129020610.14300-3-bob.c.feng@intel.com> X-Mailer: git-send-email 2.20.1.windows.1 In-Reply-To: <20190129020610.14300-1-bob.c.feng@intel.com> References: <20190129020610.14300-1-bob.c.feng@intel.com> MIME-Version: 1.0 Subject: [Patch 02/33] BaseTools:use iterate list to replace the itertools X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Jan 2019 02:06:24 -0000 Content-Transfer-Encoding: 8bit From: Zhijux Fan itertools.imap() replace map(), itertools.ifilter() replace filter Cc: Bob Feng Cc: Liming Gao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Zhiju.Fan --- BaseTools/Source/Python/build/build.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/BaseTools/Source/Python/build/build.py b/BaseTools/Source/Python/build/build.py index e79949fa28..d07c8f84d6 100644 --- a/BaseTools/Source/Python/build/build.py +++ b/BaseTools/Source/Python/build/build.py @@ -25,11 +25,10 @@ import sys import glob import time import platform import traceback import encodings.ascii -import itertools import multiprocessing from struct import * from threading import * import threading @@ -1100,13 +1099,12 @@ class Build(): if os.path.exists(PrebuildEnvFile): 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 = [l.split("=", 1) for l in envs ] + envs = [[I.strip() for I in item] for item in envs if len(item) == 2] os.environ.update(dict(envs)) EdkLogger.info("\n- Prebuild Done -\n") def LaunchPostbuild(self): if self.Postbuild: -- 2.20.1.windows.1