summaryrefslogtreecommitdiffstats
path: root/BaseTools/Source/Python/UPT/Library/Misc.py
diff options
context:
space:
mode:
authorCarsey, Jaben </o=Intel/ou=Americas01/cn=Workers/cn=Carsey, Jaben>2018-03-27 04:25:43 +0800
committerYonghong Zhu <yonghong.zhu@intel.com>2018-03-30 08:25:13 +0800
commit4231a8193ec0d52df7e0a101d96c51b1a2b7a996 (patch)
tree4fc8e46c9d51a4938e891e6b029781f1b66537ae /BaseTools/Source/Python/UPT/Library/Misc.py
parent05a32984ab799a564e2eeb7dff128fe0992910d8 (diff)
downloadedk2-4231a8193ec0d52df7e0a101d96c51b1a2b7a996.tar.gz
edk2-4231a8193ec0d52df7e0a101d96c51b1a2b7a996.tar.bz2
edk2-4231a8193ec0d52df7e0a101d96c51b1a2b7a996.zip
BaseTools: Remove equality operator with None
replace "== None" with "is None" and "!= None" with "is not None" Cc: Yonghong Zhu <yonghong.zhu@intel.com> Cc: Liming Gao <liming.gao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey <jaben.carsey@intel.com> Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
Diffstat (limited to 'BaseTools/Source/Python/UPT/Library/Misc.py')
-rw-r--r--BaseTools/Source/Python/UPT/Library/Misc.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/BaseTools/Source/Python/UPT/Library/Misc.py b/BaseTools/Source/Python/UPT/Library/Misc.py
index 0d92cb3767..719445b3bd 100644
--- a/BaseTools/Source/Python/UPT/Library/Misc.py
+++ b/BaseTools/Source/Python/UPT/Library/Misc.py
@@ -120,7 +120,7 @@ def GuidStructureStringToGuidString(GuidValue):
# @param Directory: The directory name
#
def CreateDirectory(Directory):
- if Directory == None or Directory.strip() == "":
+ if Directory is None or Directory.strip() == "":
return True
try:
if not access(Directory, F_OK):
@@ -134,7 +134,7 @@ def CreateDirectory(Directory):
# @param Directory: The directory name
#
def RemoveDirectory(Directory, Recursively=False):
- if Directory == None or Directory.strip() == "" or not \
+ if Directory is None or Directory.strip() == "" or not \
os.path.exists(Directory):
return
if Recursively:
@@ -237,7 +237,7 @@ def GetNonMetaDataFiles(Root, SkipList, FullPath, PrefixPath):
#
def ValidFile(File, Ext=None):
File = File.replace('\\', '/')
- if Ext != None:
+ if Ext is not None:
FileExt = os.path.splitext(File)[1]
if FileExt.lower() != Ext.lower():
return False
@@ -423,7 +423,7 @@ class Sdict(IterableUserDict):
## update method
#
def update(self, Dict=None, **Kwargs):
- if Dict != None:
+ if Dict is not None:
for Key1, Val1 in Dict.items():
self[Key1] = Val1
if len(Kwargs):
@@ -529,7 +529,7 @@ class PathClass(object):
## _GetFileKey
#
def _GetFileKey(self):
- if self._Key == None:
+ if self._Key is None:
self._Key = self.Path.upper()
return self._Key
## Validate