diff options
author | Carsey, Jaben </o=Intel/ou=Americas01/cn=Workers/cn=Carsey, Jaben> | 2018-03-27 04:25:43 +0800 |
---|---|---|
committer | Yonghong Zhu <yonghong.zhu@intel.com> | 2018-03-30 08:25:13 +0800 |
commit | 4231a8193ec0d52df7e0a101d96c51b1a2b7a996 (patch) | |
tree | 4fc8e46c9d51a4938e891e6b029781f1b66537ae /BaseTools/Source/Python/UPT/Library/ParserValidate.py | |
parent | 05a32984ab799a564e2eeb7dff128fe0992910d8 (diff) | |
download | edk2-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/ParserValidate.py')
-rw-r--r-- | BaseTools/Source/Python/UPT/Library/ParserValidate.py | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/BaseTools/Source/Python/UPT/Library/ParserValidate.py b/BaseTools/Source/Python/UPT/Library/ParserValidate.py index 028cf9a54f..2def90a93b 100644 --- a/BaseTools/Source/Python/UPT/Library/ParserValidate.py +++ b/BaseTools/Source/Python/UPT/Library/ParserValidate.py @@ -128,7 +128,7 @@ def IsValidInfComponentType(ComponentType): #
def IsValidToolFamily(ToolFamily):
ReIsValieFamily = re.compile(r"^[A-Z]+[A-Za-z0-9]{0,}$", re.DOTALL)
- if ReIsValieFamily.match(ToolFamily) == None:
+ if ReIsValieFamily.match(ToolFamily) is None:
return False
return True
@@ -159,7 +159,7 @@ def IsValidArch(Arch): if Arch == 'common':
return True
ReIsValieArch = re.compile(r"^[a-zA-Z]+[a-zA-Z0-9]{0,}$", re.DOTALL)
- if ReIsValieArch.match(Arch) == None:
+ if ReIsValieArch.match(Arch) is None:
return False
return True
@@ -179,7 +179,7 @@ def IsValidFamily(Family): return True
ReIsValidFamily = re.compile(r"^[A-Z]+[A-Za-z0-9]{0,}$", re.DOTALL)
- if ReIsValidFamily.match(Family) == None:
+ if ReIsValidFamily.match(Family) is None:
return False
return True
@@ -199,13 +199,13 @@ def IsValidBuildOptionName(BuildOptionName): ReIsValidBuildOption1 = re.compile(r"^\s*(\*)|([A-Z][a-zA-Z0-9]*)$")
ReIsValidBuildOption2 = re.compile(r"^\s*(\*)|([a-zA-Z][a-zA-Z0-9]*)$")
- if ReIsValidBuildOption1.match(ToolOptionList[0]) == None:
+ if ReIsValidBuildOption1.match(ToolOptionList[0]) is None:
return False
- if ReIsValidBuildOption1.match(ToolOptionList[1]) == None:
+ if ReIsValidBuildOption1.match(ToolOptionList[1]) is None:
return False
- if ReIsValidBuildOption2.match(ToolOptionList[2]) == None:
+ if ReIsValidBuildOption2.match(ToolOptionList[2]) is None:
return False
if ToolOptionList[3] == "*" and ToolOptionList[4] not in ['FAMILY', 'DLL', 'DPATH']:
@@ -442,7 +442,7 @@ def IsValidDecVersion(Word): ReIsValidDecVersion = re.compile(r"[0-9]+\.?[0-9]+$")
else:
ReIsValidDecVersion = re.compile(r"[0-9]+$")
- if ReIsValidDecVersion.match(Word) == None:
+ if ReIsValidDecVersion.match(Word) is None:
return False
return True
@@ -457,7 +457,7 @@ def IsValidDecVersion(Word): #
def IsValidHexVersion(Word):
ReIsValidHexVersion = re.compile(r"[0][xX][0-9A-Fa-f]{8}$", re.DOTALL)
- if ReIsValidHexVersion.match(Word) == None:
+ if ReIsValidHexVersion.match(Word) is None:
return False
return True
@@ -471,7 +471,7 @@ def IsValidHexVersion(Word): #
def IsValidBuildNumber(Word):
ReIsValieBuildNumber = re.compile(r"[0-9]{1,4}$", re.DOTALL)
- if ReIsValieBuildNumber.match(Word) == None:
+ if ReIsValieBuildNumber.match(Word) is None:
return False
return True
@@ -488,7 +488,7 @@ def IsValidDepex(Word): return IsValidCFormatGuid(Word[Index+4:].strip())
ReIsValidCName = re.compile(r"^[A-Za-z_][0-9A-Za-z_\s\.]*$", re.DOTALL)
- if ReIsValidCName.match(Word) == None:
+ if ReIsValidCName.match(Word) is None:
return False
return True
@@ -585,11 +585,11 @@ def IsValidPcdValue(PcdValue): return True
ReIsValidIntegerSingle = re.compile(r"^\s*[0-9]\s*$", re.DOTALL)
- if ReIsValidIntegerSingle.match(PcdValue) != None:
+ if ReIsValidIntegerSingle.match(PcdValue) is not None:
return True
ReIsValidIntegerMulti = re.compile(r"^\s*[1-9][0-9]+\s*$", re.DOTALL)
- if ReIsValidIntegerMulti.match(PcdValue) != None:
+ if ReIsValidIntegerMulti.match(PcdValue) is not None:
return True
#
@@ -654,7 +654,7 @@ def IsValidPcdValue(PcdValue): #
def IsValidCVariableName(CName):
ReIsValidCName = re.compile(r"^[A-Za-z_][0-9A-Za-z_]*$", re.DOTALL)
- if ReIsValidCName.match(CName) == None:
+ if ReIsValidCName.match(CName) is None:
return False
return True
@@ -669,7 +669,7 @@ def IsValidCVariableName(CName): #
def IsValidIdentifier(Ident):
ReIdent = re.compile(r"^[A-Za-z_][0-9A-Za-z_]*$", re.DOTALL)
- if ReIdent.match(Ident) == None:
+ if ReIdent.match(Ident) is None:
return False
return True
@@ -683,7 +683,7 @@ def IsValidIdentifier(Ident): def IsValidDecVersionVal(Ver):
ReVersion = re.compile(r"[0-9]+(\.[0-9]{1,2})$")
- if ReVersion.match(Ver) == None:
+ if ReVersion.match(Ver) is None:
return False
return True
|