Skip to content

Commit

Permalink
tools: replace deprecated iteritems() for items()
Browse files Browse the repository at this point in the history
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: #31528
Reviewed-By: Richard Lau <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Minwoo Jung <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: Christian Clauss <[email protected]>
Reviewed-By: Ben Noordhuis <[email protected]>
  • Loading branch information
Gioyik authored and codebytere committed Feb 17, 2020
1 parent eb3c6e9 commit 39c86bb
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tools/gyp/pylib/gyp/generator/compile_commands_json.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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):
Expand All @@ -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')
Expand Down

0 comments on commit 39c86bb

Please sign in to comment.