aboutsummaryrefslogtreecommitdiff
path: root/tools/gyp/pylib/gyp/generator/ninja.py
diff options
context:
space:
mode:
authorcclauss <cclauss@me.com>2019-07-05 18:39:16 +0200
committerRich Trott <rtrott@gmail.com>2019-07-16 10:40:31 -0700
commit54fcb14467b59e82d6e24bf44803462226a5de4d (patch)
tree21aceef7b5250e29be01f01e6451892a1d191a4e /tools/gyp/pylib/gyp/generator/ninja.py
parent7032e59bb550adcb448b2d24877921e7f97e7399 (diff)
downloadios-node-v8-54fcb14467b59e82d6e24bf44803462226a5de4d.tar.gz
ios-node-v8-54fcb14467b59e82d6e24bf44803462226a5de4d.tar.bz2
ios-node-v8-54fcb14467b59e82d6e24bf44803462226a5de4d.zip
gyp: cherrypick more Python3 changes from node-gyp
PR-URL: https://github.com/nodejs/node/pull/28563 Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Rich Trott <rtrott@gmail.com>
Diffstat (limited to 'tools/gyp/pylib/gyp/generator/ninja.py')
-rw-r--r--tools/gyp/pylib/gyp/generator/ninja.py20
1 files changed, 11 insertions, 9 deletions
diff --git a/tools/gyp/pylib/gyp/generator/ninja.py b/tools/gyp/pylib/gyp/generator/ninja.py
index 6140df9513..3658fb6be7 100644
--- a/tools/gyp/pylib/gyp/generator/ninja.py
+++ b/tools/gyp/pylib/gyp/generator/ninja.py
@@ -2,6 +2,8 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
+from __future__ import print_function
+
import collections
import copy
import hashlib
@@ -455,8 +457,8 @@ class NinjaWriter(object):
try:
sources = extra_sources + spec.get('sources', [])
except TypeError:
- print 'extra_sources: ', str(extra_sources)
- print 'spec.get("sources"): ', str(spec.get('sources'))
+ print('extra_sources: ', str(extra_sources))
+ print('spec.get("sources"): ', str(spec.get('sources')))
raise
if sources:
if self.flavor == 'mac' and len(self.archs) > 1:
@@ -485,8 +487,8 @@ class NinjaWriter(object):
if self.flavor != 'mac' or len(self.archs) == 1:
link_deps += [self.GypPathToNinja(o) for o in obj_outputs]
else:
- print "Warning: Actions/rules writing object files don't work with " \
- "multiarch targets, dropping. (target %s)" % spec['target_name']
+ print("Warning: Actions/rules writing object files don't work with "
+ "multiarch targets, dropping. (target %s)" % spec['target_name'])
elif self.flavor == 'mac' and len(self.archs) > 1:
link_deps = collections.defaultdict(list)
@@ -838,7 +840,7 @@ class NinjaWriter(object):
'XCASSETS_LAUNCH_IMAGE': 'launch-image',
}
settings = self.xcode_settings.xcode_settings[self.config_name]
- for settings_key, arg_name in settings_to_arg.iteritems():
+ for settings_key, arg_name in settings_to_arg.items():
value = settings.get(settings_key)
if value:
extra_arguments[arg_name] = value
@@ -1947,7 +1949,7 @@ def GenerateOutputForConfig(target_list, target_dicts, data, params,
wrappers[key[:-len('_wrapper')]] = os.path.join(build_to_root, value)
# Support wrappers from environment variables too.
- for key, value in os.environ.iteritems():
+ for key, value in os.environ.items():
if key.lower().endswith('_wrapper'):
key_prefix = key[:-len('_wrapper')]
key_prefix = re.sub(r'\.HOST$', '.host', key_prefix)
@@ -1967,7 +1969,7 @@ def GenerateOutputForConfig(target_list, target_dicts, data, params,
configs, generator_flags)
cl_paths = gyp.msvs_emulation.GenerateEnvironmentFiles(
toplevel_build, generator_flags, shared_system_includes, OpenOutput)
- for arch, path in sorted(cl_paths.iteritems()):
+ for arch, path in sorted(cl_paths.items()):
if clang_cl:
# If we have selected clang-cl, use that instead.
path = clang_cl
@@ -2442,7 +2444,7 @@ def PerformBuild(data, configurations, params):
for config in configurations:
builddir = os.path.join(options.toplevel_dir, 'out', config)
arguments = ['ninja', '-C', builddir]
- print 'Building [%s]: %s' % (config, arguments)
+ print('Building [%s]: %s' % (config, arguments))
subprocess.check_call(arguments)
@@ -2479,7 +2481,7 @@ def GenerateOutput(target_list, target_dicts, data, params):
arglists.append(
(target_list, target_dicts, data, params, config_name))
pool.map(CallGenerateOutputForConfig, arglists)
- except KeyboardInterrupt, e:
+ except KeyboardInterrupt as e:
pool.terminate()
raise e
else: