diff options
author | Carsey, Jaben </o=Intel/ou=Americas01/cn=Workers/cn=Carsey, Jaben> | 2018-04-13 08:02:10 +0800 |
---|---|---|
committer | Yonghong Zhu <yonghong.zhu@intel.com> | 2018-04-17 20:49:32 +0800 |
commit | 128d435f5e572733ab2649c4494f5d4f786b6f6b (patch) | |
tree | 67c27162da6af724a8d93da66946971c3cb1c33b /BaseTools/Source/Python/Workspace | |
parent | 72fbe88d7290cfc4196658898ea8c5e28d539502 (diff) | |
download | edk2-128d435f5e572733ab2649c4494f5d4f786b6f6b.tar.gz edk2-128d435f5e572733ab2649c4494f5d4f786b6f6b.tar.bz2 edk2-128d435f5e572733ab2649c4494f5d4f786b6f6b.zip |
BaseTools: fix None comparisons
when comparing a list/string against None and empty, just compare the object.
when comparing against None, dont use !=, ==, <>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@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/Workspace')
-rw-r--r-- | BaseTools/Source/Python/Workspace/DscBuildData.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/BaseTools/Source/Python/Workspace/DscBuildData.py b/BaseTools/Source/Python/Workspace/DscBuildData.py index fcd3132860..7ffb825efa 100644 --- a/BaseTools/Source/Python/Workspace/DscBuildData.py +++ b/BaseTools/Source/Python/Workspace/DscBuildData.py @@ -2292,7 +2292,7 @@ class DscBuildData(PlatformBuildClassObject): pcdDecObject = self._DecPcds[pcd.TokenCName, pcd.TokenSpaceGuidCName]
# Only fix the value while no value provided in DSC file.
for sku in pcd.SkuInfoList.values():
- if (sku.DefaultValue == "" or sku.DefaultValue==None):
+ if not sku.DefaultValue:
sku.DefaultValue = pcdDecObject.DefaultValue
if 'DEFAULT' not in pcd.SkuInfoList.keys() and 'COMMON' not in pcd.SkuInfoList.keys():
valuefromDec = pcdDecObject.DefaultValue
@@ -2624,7 +2624,7 @@ class DscBuildData(PlatformBuildClassObject): pcd.DatumType = pcdDecObject.DatumType
# Only fix the value while no value provided in DSC file.
for sku in pcd.SkuInfoList.values():
- if (sku.DefaultValue == "" or sku.DefaultValue==None):
+ if not sku.DefaultValue:
sku.DefaultValue = pcdDecObject.DefaultValue
if 'DEFAULT' not in pcd.SkuInfoList.keys() and 'COMMON' not in pcd.SkuInfoList.keys():
valuefromDec = pcdDecObject.DefaultValue
|