summaryrefslogtreecommitdiff
path: root/BaseTools
diff options
context:
space:
mode:
authorJordan Justen <jordan.l.justen@intel.com>2016-03-16 16:14:14 -0700
committerHao Wu <hao.a.wu@intel.com>2016-07-13 09:33:58 +0800
commit4f9fb18fa7ffdb81361da59e9bbf9f68d80e39f5 (patch)
treeb6093ac863b92888e715cc49d45690a09d88d0c3 /BaseTools
parent58e89e1f35d8d523e14097c1cb16c6759264beec (diff)
downloadedk2-platforms-4f9fb18fa7ffdb81361da59e9bbf9f68d80e39f5.tar.xz
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> (cherry picked from commit 90694f121865073c93123c41046349ca84eb1a25)
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])