summaryrefslogtreecommitdiffstats
path: root/BaseTools
diff options
context:
space:
mode:
authorJordan Justen <jordan.l.justen@intel.com>2016-03-16 16:14:14 -0700
committerJordan Justen <jordan.l.justen@intel.com>2016-06-28 13:16:39 -0700
commit90694f121865073c93123c41046349ca84eb1a25 (patch)
tree2b436e34afe17d66fe6623a6650865267847c6d3 /BaseTools
parentc8102434ba8703ff3bd18d8f53675c2de3830f97 (diff)
downloadedk2-90694f121865073c93123c41046349ca84eb1a25.tar.gz
edk2-90694f121865073c93123c41046349ca84eb1a25.tar.bz2
edk2-90694f121865073c93123c41046349ca84eb1a25.zip
BaseTools ConvertMasmToNasm: put filter/map result in tuple for python3
Python 3's filter and map functions returns an iterator which you can't call len() on. Since we'll want to use len() later, we put the filter results into a tuple. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jordan Justen <jordan.l.justen@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
Diffstat (limited to 'BaseTools')
-rwxr-xr-xBaseTools/Scripts/ConvertMasmToNasm.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/BaseTools/Scripts/ConvertMasmToNasm.py b/BaseTools/Scripts/ConvertMasmToNasm.py
index 8b08a88557..6343fbd94c 100755
--- a/BaseTools/Scripts/ConvertMasmToNasm.py
+++ b/BaseTools/Scripts/ConvertMasmToNasm.py
@@ -473,7 +473,7 @@ class ConvertAsmFile(CommonUtils):
self.EmitAsmWithComment(oldAsm, newAsm, endOfLine)
uses = self.mo.group(3)
if uses is not None:
- uses = filter(None, uses.split())
+ uses = tuple(filter(None, uses.split()))
else:
uses = tuple()
self.uses = uses
@@ -484,7 +484,7 @@ class ConvertAsmFile(CommonUtils):
self.EmitAsmWithComment(oldAsm, newAsm, endOfLine)
elif self.MatchAndSetMo(self.publicRe, oldAsm):
publics = re.findall(self.varAndTypeSubRe, self.mo.group(1))
- publics = map(lambda p: p.split(':')[0].strip(), publics)
+ publics = tuple(map(lambda p: p.split(':')[0].strip(), publics))
for i in range(len(publics) - 1):
name = publics[i]
self.EmitNewContent('global ASM_PFX(%s)' % publics[i])