summaryrefslogtreecommitdiffstats
path: root/BaseTools/Source/Python/Common
diff options
context:
space:
mode:
Diffstat (limited to 'BaseTools/Source/Python/Common')
-rw-r--r--BaseTools/Source/Python/Common/Misc.py8
-rw-r--r--BaseTools/Source/Python/Common/String.py12
2 files changed, 10 insertions, 10 deletions
diff --git a/BaseTools/Source/Python/Common/Misc.py b/BaseTools/Source/Python/Common/Misc.py
index fe5a0b8101..90350f8638 100644
--- a/BaseTools/Source/Python/Common/Misc.py
+++ b/BaseTools/Source/Python/Common/Misc.py
@@ -833,7 +833,7 @@ class TemplateString(object):
def Append(self, AppendString, Dictionary=None):
if Dictionary:
SectionList = self._Parse(AppendString)
- self.String += "".join([S.Instantiate(Dictionary) for S in SectionList])
+ self.String += "".join(S.Instantiate(Dictionary) for S in SectionList)
else:
self.String += AppendString
@@ -844,7 +844,7 @@ class TemplateString(object):
# @retval str The string replaced with placeholder values
#
def Replace(self, Dictionary=None):
- return "".join([S.Instantiate(Dictionary) for S in self._TemplateSectionList])
+ return "".join(S.Instantiate(Dictionary) for S in self._TemplateSectionList)
## Progress indicator class
#
@@ -1926,7 +1926,7 @@ class DefaultStore():
if not self.DefaultStores or "0" in self.DefaultStores:
return "0",TAB_DEFAULT_STORES_DEFAULT
else:
- minvalue = min([int(value_str) for value_str in self.DefaultStores])
+ minvalue = min(int(value_str) for value_str in self.DefaultStores)
return (str(minvalue), self.DefaultStores[str(minvalue)])
def GetMin(self,DefaultSIdList):
if not DefaultSIdList:
@@ -2023,7 +2023,7 @@ class SkuClass():
skuorderset.append(self.GetSkuChain(skuname))
skuorder = []
- for index in range(max([len(item) for item in skuorderset])):
+ for index in range(max(len(item) for item in skuorderset)):
for subset in skuorderset:
if index > len(subset)-1:
continue
diff --git a/BaseTools/Source/Python/Common/String.py b/BaseTools/Source/Python/Common/String.py
index ee26d7f7b1..34361ecdd5 100644
--- a/BaseTools/Source/Python/Common/String.py
+++ b/BaseTools/Source/Python/Common/String.py
@@ -818,27 +818,27 @@ def StringToArray(String):
if isinstance(String, unicode):
if len(unicode) == 0:
return "{0x00,0x00}"
- return "{%s,0x00,0x00}" % ",".join(["0x%02x,0x00" % ord(C) for C in String])
+ return "{%s,0x00,0x00}" % ",".join("0x%02x,0x00" % ord(C) for C in String)
elif String.startswith('L"'):
if String == "L\"\"":
return "{0x00,0x00}"
else:
- return "{%s,0x00,0x00}" % ",".join(["0x%02x,0x00" % ord(C) for C in String[2:-1]])
+ return "{%s,0x00,0x00}" % ",".join("0x%02x,0x00" % ord(C) for C in String[2:-1])
elif String.startswith('"'):
if String == "\"\"":
return "{0x00,0x00}"
else:
StringLen = len(String[1:-1])
if StringLen % 2:
- return "{%s,0x00}" % ",".join(["0x%02x" % ord(C) for C in String[1:-1]])
+ return "{%s,0x00}" % ",".join("0x%02x" % ord(C) for C in String[1:-1])
else:
- return "{%s,0x00,0x00}" % ",".join(["0x%02x" % ord(C) for C in String[1:-1]])
+ return "{%s,0x00,0x00}" % ",".join("0x%02x" % ord(C) for C in String[1:-1])
elif String.startswith('{'):
StringLen = len(String.split(","))
if StringLen % 2:
- return "{%s,0x00}" % ",".join([ C.strip() for C in String[1:-1].split(',')])
+ return "{%s,0x00}" % ",".join(C.strip() for C in String[1:-1].split(','))
else:
- return "{%s}" % ",".join([ C.strip() for C in String[1:-1].split(',')])
+ return "{%s}" % ",".join(C.strip() for C in String[1:-1].split(','))
else:
if len(String.split()) % 2: