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/InfBinaryObject.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'BaseTools/Source/Python/UPT/Object/Parser/InfBinaryObject.py') diff --git a/BaseTools/Source/Python/UPT/Object/Parser/InfBinaryObject.py b/BaseTools/Source/Python/UPT/Object/Parser/InfBinaryObject.py index 33b142d64e..cc2fc49053 100644 --- a/BaseTools/Source/Python/UPT/Object/Parser/InfBinaryObject.py +++ b/BaseTools/Source/Python/UPT/Object/Parser/InfBinaryObject.py @@ -272,7 +272,7 @@ class InfBinariesObject(InfSectionCommonDef): pass if InfBianryVerItemObj is not None: - if self.Binaries.has_key((InfBianryVerItemObj)): + if (InfBianryVerItemObj) in self.Binaries: BinariesList = self.Binaries[InfBianryVerItemObj] BinariesList.append((InfBianryVerItemObj, VerComment)) self.Binaries[InfBianryVerItemObj] = BinariesList @@ -522,7 +522,7 @@ class InfBinariesObject(InfSectionCommonDef): # pass if InfBianryCommonItemObj is not None: - if self.Binaries.has_key((InfBianryCommonItemObj)): + if (InfBianryCommonItemObj) in self.Binaries: BinariesList = self.Binaries[InfBianryCommonItemObj] BinariesList.append((InfBianryCommonItemObj, ItemComment)) self.Binaries[InfBianryCommonItemObj] = BinariesList @@ -673,7 +673,7 @@ class InfBinariesObject(InfSectionCommonDef): # pass if InfBianryUiItemObj is not None: - if self.Binaries.has_key((InfBianryUiItemObj)): + if (InfBianryUiItemObj) in self.Binaries: BinariesList = self.Binaries[InfBianryUiItemObj] BinariesList.append((InfBianryUiItemObj, UiComment)) self.Binaries[InfBianryUiItemObj] = BinariesList -- cgit v1.2.3