Skip to content

Commit b31156a

Browse files
committed
Fix Makefile export with Python 3
In Python 3, the map() function returns a map object, not a list object as in Python 2. Ensure a list object is returned from format_flags() by wrapping map() in list(). This is compatible with both Python 2 and 3.
1 parent 503066a commit b31156a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tools/export/makefile/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ def format_flags(self):
165165
flags = {}
166166
for k, v in self.flags.items():
167167
if k in ['c_flags', 'cxx_flags']:
168-
flags[k] = map(lambda x: x.replace('"', '\\"'), v)
168+
flags[k] = list(map(lambda x: x.replace('"', '\\"'), v))
169169
else:
170170
flags[k] = v
171171

0 commit comments

Comments
 (0)