From 87d2afd07c822e6d5ab12bc8dc0f0bfa31bea679 Mon Sep 17 00:00:00 2001 From: Gary Lin Date: Mon, 25 Jun 2018 18:31:27 +0800 Subject: BaseTools: Remove the old python "not-equal" Replace "<>" with "!=" to be compatible with python3. 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/AutoGen/AutoGen.py | 2 +- BaseTools/Source/Python/AutoGen/BuildEngine.py | 4 ++-- BaseTools/Source/Python/AutoGen/GenMake.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) (limited to 'BaseTools/Source/Python/AutoGen') diff --git a/BaseTools/Source/Python/AutoGen/AutoGen.py b/BaseTools/Source/Python/AutoGen/AutoGen.py index e268c4c0a1..d748590941 100644 --- a/BaseTools/Source/Python/AutoGen/AutoGen.py +++ b/BaseTools/Source/Python/AutoGen/AutoGen.py @@ -4233,7 +4233,7 @@ class ModuleAutoGen(AutoGen): Dpx = GenDepex.DependencyExpression(self.DepexList[ModuleType], ModuleType, True) DpxFile = gAutoGenDepexFileName % {"module_name" : self.Name} - if len(Dpx.PostfixNotation) <> 0: + if len(Dpx.PostfixNotation) != 0: self.DepexGenerated = True if Dpx.Generate(path.join(self.OutputDir, DpxFile)): diff --git a/BaseTools/Source/Python/AutoGen/BuildEngine.py b/BaseTools/Source/Python/AutoGen/BuildEngine.py index d4daa30937..cab4c993dc 100644 --- a/BaseTools/Source/Python/AutoGen/BuildEngine.py +++ b/BaseTools/Source/Python/AutoGen/BuildEngine.py @@ -362,8 +362,8 @@ class BuildRule: self.RuleContent[Index] = Line # find the build_rule_version - if Line and Line[0] == "#" and Line.find(TAB_BUILD_RULE_VERSION) <> -1: - if Line.find("=") <> -1 and Line.find("=") < (len(Line) - 1) and (Line[(Line.find("=") + 1):]).split(): + if Line and Line[0] == "#" and Line.find(TAB_BUILD_RULE_VERSION) != -1: + if Line.find("=") != -1 and Line.find("=") < (len(Line) - 1) and (Line[(Line.find("=") + 1):]).split(): self._FileVersion = (Line[(Line.find("=") + 1):]).split()[0] # skip empty or comment line if Line == "" or Line[0] == "#": diff --git a/BaseTools/Source/Python/AutoGen/GenMake.py b/BaseTools/Source/Python/AutoGen/GenMake.py index 48b66c570e..ea73de5fa5 100644 --- a/BaseTools/Source/Python/AutoGen/GenMake.py +++ b/BaseTools/Source/Python/AutoGen/GenMake.py @@ -561,7 +561,7 @@ cleanlib: # convert source files and binary files to build targets self.ResultFileList = [str(T.Target) for T in self._AutoGenObject.CodaTargetList] - if len(self.ResultFileList) == 0 and len(self._AutoGenObject.SourceFileList) <> 0: + if len(self.ResultFileList) == 0 and len(self._AutoGenObject.SourceFileList) != 0: EdkLogger.error("build", AUTOGEN_ERROR, "Nothing to build", ExtraData="[%s]" % str(self._AutoGenObject)) -- cgit v1.2.3