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.
pull/8577/head
Lasse Bang Mikkelsen 2018-10-29 18:46:43 +01:00
parent 503066a736
commit b31156a906
No known key found for this signature in database
GPG Key ID: 5FB75AB9E0AB5EC2
1 changed files with 1 additions and 1 deletions

View File

@ -165,7 +165,7 @@ class Makefile(Exporter):
flags = {}
for k, v in self.flags.items():
if k in ['c_flags', 'cxx_flags']:
flags[k] = map(lambda x: x.replace('"', '\\"'), v)
flags[k] = list(map(lambda x: x.replace('"', '\\"'), v))
else:
flags[k] = v