From 4f9fb18fa7ffdb81361da59e9bbf9f68d80e39f5 Mon Sep 17 00:00:00 2001 From: Jordan Justen Date: Wed, 16 Mar 2016 16:14:14 -0700 Subject: 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 Reviewed-by: Liming Gao (cherry picked from commit 90694f121865073c93123c41046349ca84eb1a25) --- BaseTools/Scripts/ConvertMasmToNasm.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'BaseTools') 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]) -- cgit v1.2.3