From b31156a906c0f0efdfe4e179cf9e786024f01c27 Mon Sep 17 00:00:00 2001 From: Lasse Bang Mikkelsen Date: Mon, 29 Oct 2018 18:46:43 +0100 Subject: [PATCH] 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. --- tools/export/makefile/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/export/makefile/__init__.py b/tools/export/makefile/__init__.py index e812e2be49..430435e3bc 100644 --- a/tools/export/makefile/__init__.py +++ b/tools/export/makefile/__init__.py @@ -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