From 4231a8193ec0d52df7e0a101d96c51b1a2b7a996 Mon Sep 17 00:00:00 2001 From: "Carsey, Jaben" Date: Tue, 27 Mar 2018 04:25:43 +0800 Subject: BaseTools: Remove equality operator with None replace "== None" with "is None" and "!= None" with "is not None" Cc: Yonghong Zhu Cc: Liming Gao Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey Reviewed-by: Yonghong Zhu --- BaseTools/Source/Python/Workspace/WorkspaceCommon.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'BaseTools/Source/Python/Workspace/WorkspaceCommon.py') diff --git a/BaseTools/Source/Python/Workspace/WorkspaceCommon.py b/BaseTools/Source/Python/Workspace/WorkspaceCommon.py index c760e57b8f..abe34cf9a0 100644 --- a/BaseTools/Source/Python/Workspace/WorkspaceCommon.py +++ b/BaseTools/Source/Python/Workspace/WorkspaceCommon.py @@ -118,16 +118,16 @@ def _GetModuleLibraryInstances(Module, Platform, BuildDatabase, Arch, Target, To LibraryPath = PlatformModule.LibraryClasses[LibraryClassName] else: LibraryPath = Platform.LibraryClasses[LibraryClassName, ModuleType] - if LibraryPath == None or LibraryPath == "": + if LibraryPath is None or LibraryPath == "": LibraryPath = M.LibraryClasses[LibraryClassName] - if LibraryPath == None or LibraryPath == "": + if LibraryPath is None or LibraryPath == "": return [] LibraryModule = BuildDatabase[LibraryPath, Arch, Target, Toolchain] # for those forced library instance (NULL library), add a fake library class if LibraryClassName.startswith("NULL"): LibraryModule.LibraryClass.append(LibraryClassObject(LibraryClassName, [ModuleType])) - elif LibraryModule.LibraryClass == None \ + elif LibraryModule.LibraryClass is None \ or len(LibraryModule.LibraryClass) == 0 \ or (ModuleType != 'USER_DEFINED' and ModuleType not in LibraryModule.LibraryClass[0].SupModList): @@ -139,7 +139,7 @@ def _GetModuleLibraryInstances(Module, Platform, BuildDatabase, Arch, Target, To else: LibraryModule = LibraryInstance[LibraryClassName] - if LibraryModule == None: + if LibraryModule is None: continue if LibraryModule.ConstructorList != [] and LibraryModule not in Constructor: @@ -239,12 +239,12 @@ def _ResolveLibraryReference(Module, Platform): M = LibraryConsumerList.pop() for LibraryName in M.Libraries: Library = Platform.LibraryClasses[LibraryName, ':dummy:'] - if Library == None: + if Library is None: for Key in Platform.LibraryClasses.data.keys(): if LibraryName.upper() == Key.upper(): Library = Platform.LibraryClasses[Key, ':dummy:'] break - if Library == None: + if Library is None: continue if Library not in LibraryList: -- cgit v1.2.3