From 2f81d59e754b4564db7a3450280612e4e5f9079a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Zasso?= Date: Tue, 3 Sep 2019 09:46:55 +0200 Subject: [PATCH] tools: fix GYP ninja generator for Python 3 PR-URL: https://github.com/nodejs/node/pull/29416 Reviewed-By: Christian Clauss Reviewed-By: Rich Trott Reviewed-By: Ujjwal Sharma Reviewed-By: Ben Noordhuis --- tools/gyp/pylib/gyp/generator/ninja.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tools/gyp/pylib/gyp/generator/ninja.py b/tools/gyp/pylib/gyp/generator/ninja.py index e66979ddbb5273..75743e770d16f9 100644 --- a/tools/gyp/pylib/gyp/generator/ninja.py +++ b/tools/gyp/pylib/gyp/generator/ninja.py @@ -355,7 +355,7 @@ def WriteCollapsedDependencies(self, name, targets, order_only=None): Uses a stamp file if necessary.""" - assert targets == filter(None, targets), targets + assert targets == [item for item in targets if item], targets if len(targets) == 0: assert not order_only return None @@ -432,8 +432,8 @@ def WriteSpec(self, spec, config_name, generator_flags): compile_depends.append(target.PreCompileInput()) if target.uses_cpp: self.target.uses_cpp = True - actions_depends = filter(None, actions_depends) - compile_depends = filter(None, compile_depends) + actions_depends = [item for item in actions_depends if item] + compile_depends = [item for item in compile_depends if item] actions_depends = self.WriteCollapsedDependencies('actions_depends', actions_depends) compile_depends = self.WriteCollapsedDependencies('compile_depends', @@ -2381,6 +2381,7 @@ def GenerateOutputForConfig(target_list, target_dicts, data, params, qualified_target_for_hash = gyp.common.QualifiedTarget(build_file, name, toolset) + qualified_target_for_hash = qualified_target_for_hash.encode('utf-8') hash_for_rules = hashlib.md5(qualified_target_for_hash).hexdigest() base_path = os.path.dirname(build_file)