From 289f3dc5385c2fe12827859edbe6ea626a0d9289 Mon Sep 17 00:00:00 2001 From: "Giovanny Andres Gongora Granada (Gioyik)" Date: Sun, 26 Jan 2020 17:27:24 -0500 Subject: [PATCH] tools: replace deprecated iteritems() for items() This is a Built-In change in Python 3 used by compile_commands_json.py to generate compile_commands_json.json. Node.js dropped Python 2 support in this script, `items()` works as expected replacement. PR-URL: https://github.com/nodejs/node/pull/31528 Reviewed-By: Richard Lau Reviewed-By: Colin Ihrig Reviewed-By: Minwoo Jung Reviewed-By: Rich Trott Reviewed-By: Christian Clauss Reviewed-By: Ben Noordhuis --- tools/gyp/pylib/gyp/generator/compile_commands_json.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/gyp/pylib/gyp/generator/compile_commands_json.py b/tools/gyp/pylib/gyp/generator/compile_commands_json.py index 575db63c4e1943..1b8490451f9793 100644 --- a/tools/gyp/pylib/gyp/generator/compile_commands_json.py +++ b/tools/gyp/pylib/gyp/generator/compile_commands_json.py @@ -43,7 +43,7 @@ def CalculateVariables(default_variables, params): def AddCommandsForTarget(cwd, target, params, per_config_commands): output_dir = params['generator_flags']['output_dir'] - for configuration_name, configuration in target['configurations'].iteritems(): + for configuration_name, configuration in target['configurations'].items(): builddir_name = os.path.join(output_dir, configuration_name) if IsMac(params): @@ -92,7 +92,7 @@ def resolve(filename): def GenerateOutput(target_list, target_dicts, data, params): per_config_commands = {} - for qualified_target, target in target_dicts.iteritems(): + for qualified_target, target in target_dicts.items(): build_file, target_name, toolset = ( gyp.common.ParseQualifiedTarget(qualified_target)) if IsMac(params): @@ -102,7 +102,7 @@ def GenerateOutput(target_list, target_dicts, data, params): AddCommandsForTarget(cwd, target, params, per_config_commands) output_dir = params['generator_flags']['output_dir'] - for configuration_name, commands in per_config_commands.iteritems(): + for configuration_name, commands in per_config_commands.items(): filename = os.path.join(output_dir, configuration_name, 'compile_commands.json')