From 27c4ceb41cf6b79d440deae215c68e117d69d641 Mon Sep 17 00:00:00 2001 From: Gary Lin Date: Mon, 25 Jun 2018 18:31:29 +0800 Subject: BaseTools: Remove the deprecated hash_key() Replace "has_key()" with "in" to be compatible with python3. Based on "futurize -f lib2to3.fixes.fix_has_key" Contributed-under: TianoCore Contribution Agreement 1.1 Cc: Yonghong Zhu Cc: Liming Gao Signed-off-by: Gary Lin Reviewed-by: Yonghong Zhu --- BaseTools/Source/Python/UPT/Object/Parser/InfPackagesObject.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'BaseTools/Source/Python/UPT/Object/Parser/InfPackagesObject.py') diff --git a/BaseTools/Source/Python/UPT/Object/Parser/InfPackagesObject.py b/BaseTools/Source/Python/UPT/Object/Parser/InfPackagesObject.py index 01c854a847..bfac2b6b57 100644 --- a/BaseTools/Source/Python/UPT/Object/Parser/InfPackagesObject.py +++ b/BaseTools/Source/Python/UPT/Object/Parser/InfPackagesObject.py @@ -171,7 +171,7 @@ class InfPackageObject(): # pass - if self.Packages.has_key((PackageItemObj)): + if (PackageItemObj) in self.Packages: PackageList = self.Packages[PackageItemObj] PackageList.append(PackageItemObj) self.Packages[PackageItemObj] = PackageList @@ -184,4 +184,4 @@ class InfPackageObject(): def GetPackages(self, Arch = None): if Arch is None: - return self.Packages \ No newline at end of file + return self.Packages -- cgit v1.2.3