if BuildData.Pcds[key].Pending:\r
if key in Platform.Pcds:\r
PcdInPlatform = Platform.Pcds[key]\r
- if PcdInPlatform.Type not in [None, '']:\r
+ if PcdInPlatform.Type:\r
BuildData.Pcds[key].Type = PcdInPlatform.Type\r
\r
if BuildData.MetaFile in Platform.Modules:\r
PlatformModule = Platform.Modules[str(BuildData.MetaFile)]\r
if key in PlatformModule.Pcds:\r
PcdInPlatform = PlatformModule.Pcds[key]\r
- if PcdInPlatform.Type not in [None, '']:\r
+ if PcdInPlatform.Type:\r
BuildData.Pcds[key].Type = PcdInPlatform.Type\r
\r
if TAB_PCDS_DYNAMIC_EX in BuildData.Pcds[key].Type:\r
'build',\r
FORMAT_INVALID,\r
"Building modules from source INFs, following PCD use %s and %s access method. It must be corrected to use only one access method." % (i, j),\r
- ExtraData="%s" % '\n\t'.join([str(P[1]+'.'+P[0]) for P in Intersections])\r
+ ExtraData="%s" % '\n\t'.join(str(P[1]+'.'+P[0]) for P in Intersections)\r
)\r
\r
#\r
\r
for PcdFromModule in M.ModulePcdList + M.LibraryPcdList:\r
# make sure that the "VOID*" kind of datum has MaxDatumSize set\r
- if PcdFromModule.DatumType == TAB_VOID and PcdFromModule.MaxDatumSize in [None, '']:\r
+ if PcdFromModule.DatumType == TAB_VOID and not PcdFromModule.MaxDatumSize:\r
NoDatumTypePcdList.add("%s.%s [%s]" % (PcdFromModule.TokenSpaceGuidCName, PcdFromModule.TokenCName, F))\r
\r
# Check the PCD from Binary INF or Source INF\r
ExtraData="\n\tExisted %s PCD %s in:\n\t\t%s\n"\r
% (PcdFromModule.Type, PcdFromModule.TokenCName, InfName))\r
# make sure that the "VOID*" kind of datum has MaxDatumSize set\r
- if PcdFromModule.DatumType == TAB_VOID and PcdFromModule.MaxDatumSize in [None, '']:\r
+ if PcdFromModule.DatumType == TAB_VOID and not PcdFromModule.MaxDatumSize:\r
NoDatumTypePcdList.add("%s.%s [%s]" % (PcdFromModule.TokenSpaceGuidCName, PcdFromModule.TokenCName, InfName))\r
if M.ModuleType in SUP_MODULE_SET_PEI:\r
PcdFromModule.Phase = "PEI"\r
BuildRuleFile = None\r
if TAB_TAT_DEFINES_BUILD_RULE_CONF in self.Workspace.TargetTxt.TargetTxtDictionary:\r
BuildRuleFile = self.Workspace.TargetTxt.TargetTxtDictionary[TAB_TAT_DEFINES_BUILD_RULE_CONF]\r
- if BuildRuleFile in [None, '']:\r
+ if not BuildRuleFile:\r
BuildRuleFile = gDefaultBuildRuleFile\r
self._BuildRule = BuildRule(BuildRuleFile)\r
if self._BuildRule._FileVersion == "":\r
#\r
for Item in LibraryList:\r
if ConsumedByList[Item] != [] and Item in Constructor and len(Constructor) > 1:\r
- ErrorMessage = "\tconsumed by " + "\n\tconsumed by ".join([str(L) for L in ConsumedByList[Item]])\r
+ ErrorMessage = "\tconsumed by " + "\n\tconsumed by ".join(str(L) for L in ConsumedByList[Item])\r
EdkLogger.error("build", BUILD_ERROR, 'Library [%s] with constructors has a cycle' % str(Item),\r
ExtraData=ErrorMessage, File=self.MetaFile)\r
if Item not in SortedLibraryList:\r
TokenCName = PcdItem[0]\r
break\r
if FromPcd is not None:\r
- if ToPcd.Pending and FromPcd.Type not in [None, '']:\r
+ if ToPcd.Pending and FromPcd.Type:\r
ToPcd.Type = FromPcd.Type\r
- elif (ToPcd.Type not in [None, '']) and (FromPcd.Type not in [None, ''])\\r
+ elif (ToPcd.Type) and (FromPcd.Type)\\r
and (ToPcd.Type != FromPcd.Type) and (ToPcd.Type in FromPcd.Type):\r
if ToPcd.Type.strip() == TAB_PCDS_DYNAMIC_EX:\r
ToPcd.Type = FromPcd.Type\r
- elif ToPcd.Type not in [None, ''] and FromPcd.Type not in [None, ''] \\r
+ elif ToPcd.Type and FromPcd.Type \\r
and ToPcd.Type != FromPcd.Type:\r
EdkLogger.error("build", OPTION_CONFLICT, "Mismatched PCD type",\r
ExtraData="%s.%s is defined as [%s] in module %s, but as [%s] in platform."\\r
ToPcd.validlists = FromPcd.validlists\r
ToPcd.expressions = FromPcd.expressions\r
\r
- if FromPcd is not None and ToPcd.DatumType == TAB_VOID and ToPcd.MaxDatumSize in ['', None]:\r
+ if FromPcd is not None and ToPcd.DatumType == TAB_VOID and not ToPcd.MaxDatumSize:\r
EdkLogger.debug(EdkLogger.DEBUG_9, "No MaxDatumSize specified for PCD %s.%s" \\r
% (ToPcd.TokenSpaceGuidCName, TokenCName))\r
Value = ToPcd.DefaultValue\r
- if Value in [None, '']:\r
+ if not Value:\r
ToPcd.MaxDatumSize = '1'\r
elif Value[0] == 'L':\r
ToPcd.MaxDatumSize = str((len(Value) - 2) * 2)\r
\r
# apply default SKU for dynamic PCDS if specified one is not available\r
if (ToPcd.Type in PCD_DYNAMIC_TYPE_SET or ToPcd.Type in PCD_DYNAMIC_EX_TYPE_SET) \\r
- and ToPcd.SkuInfoList in [None, {}, '']:\r
+ and not ToPcd.SkuInfoList:\r
if self.Platform.SkuName in self.Platform.SkuIds:\r
SkuName = self.Platform.SkuName\r
else:\r
if Sku.VariableGuid == '': continue\r
Sku.VariableGuidValue = GuidValue(Sku.VariableGuid, self.PackageList, self.MetaFile.Path)\r
if Sku.VariableGuidValue is None:\r
- PackageList = "\n\t".join([str(P) for P in self.PackageList])\r
+ PackageList = "\n\t".join(str(P) for P in self.PackageList)\r
EdkLogger.error(\r
'build',\r
RESOURCE_NOT_AVAILABLE,\r
# use PCD value to calculate the MaxDatumSize when it is not specified\r
for Name, Guid in Pcds:\r
Pcd = Pcds[Name, Guid]\r
- if Pcd.DatumType == TAB_VOID and Pcd.MaxDatumSize in ['', None]:\r
+ if Pcd.DatumType == TAB_VOID and not Pcd.MaxDatumSize:\r
Pcd.MaxSizeUserSet = None\r
Value = Pcd.DefaultValue\r
- if Value in [None, '']:\r
+ if not Value:\r
Pcd.MaxDatumSize = '1'\r
elif Value[0] == 'L':\r
Pcd.MaxDatumSize = str((len(Value) - 2) * 2)\r
for Depex in DepexList:\r
for key in Depex:\r
DepexStr += '[Depex.%s.%s]\n' % key\r
- DepexStr += '\n'.join(['# '+ val for val in Depex[key]])\r
+ DepexStr += '\n'.join('# '+ val for val in Depex[key])\r
DepexStr += '\n\n'\r
if not DepexStr:\r
return '[Depex.%s]\n' % self.Arch\r
DepexStr += ' AND '\r
DepexStr += '('\r
for D in Depex.values():\r
- DepexStr += ' '.join([val for val in D])\r
+ DepexStr += ' '.join(val for val in D)\r
Index = DepexStr.find('END')\r
if Index > -1 and Index == len(DepexStr) - 3:\r
DepexStr = DepexStr[:-3]\r