Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(93)

Unified Diff: pylib/gyp/xcode_emulation.py

Issue 1454433002: Python 3 compatibility Base URL: https://chromium.googlesource.com/external/gyp.git@master
Patch Set: Rebase with master (4ec6c4e3a94bd04a6da2858163d40b2429b8aad1) Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: pylib/gyp/xcode_emulation.py
diff --git a/pylib/gyp/xcode_emulation.py b/pylib/gyp/xcode_emulation.py
index 2dec19e5d6fb548bd2002c37f88dbcf0086eecab..22bac4d786f7f83044f19ac3477ba6350d5a73f8 100644
--- a/pylib/gyp/xcode_emulation.py
+++ b/pylib/gyp/xcode_emulation.py
@@ -7,6 +7,8 @@ This module contains classes that help to emulate xcodebuild behavior on top of
other build systems, such as make and ninja.
"""
+from __future__ import print_function
+
import copy
import gyp.common
import os
@@ -73,7 +75,7 @@ class XcodeArchsDefault(object):
if arch not in expanded_archs:
expanded_archs.append(arch)
except KeyError as e:
- print 'Warning: Ignoring unsupported variable "%s".' % variable
+ print('Warning: Ignoring unsupported variable "%s".' % variable)
elif arch not in expanded_archs:
expanded_archs.append(arch)
return expanded_archs
@@ -171,7 +173,7 @@ class XcodeSettings(object):
# the same for all configs are implicitly per-target settings.
self.xcode_settings = {}
configs = spec['configurations']
- for configname, config in configs.iteritems():
+ for configname, config in configs.items():
self.xcode_settings[configname] = config.get('xcode_settings', {})
self._ConvertConditionalKeys(configname)
if self.xcode_settings[configname].get('IPHONEOS_DEPLOYMENT_TARGET',
@@ -197,8 +199,8 @@ class XcodeSettings(object):
new_key = key.split("[")[0]
settings[new_key] = settings[key]
else:
- print 'Warning: Conditional keys not implemented, ignoring:', \
- ' '.join(conditional_keys)
+ print('Warning: Conditional keys not implemented, ignoring:', \
+ ' '.join(conditional_keys))
del settings[key]
def _Settings(self):
@@ -216,7 +218,7 @@ class XcodeSettings(object):
def _WarnUnimplemented(self, test_key):
if test_key in self._Settings():
- print 'Warning: Ignoring not yet implemented key "%s".' % test_key
+ print('Warning: Ignoring not yet implemented key "%s".' % test_key)
def IsBinaryOutputFormat(self, configname):
default = "binary" if self.isIOS else "xml"
@@ -906,7 +908,7 @@ class XcodeSettings(object):
result = dict(self.xcode_settings[configname])
first_pass = False
else:
- for key, value in self.xcode_settings[configname].iteritems():
+ for key, value in self.xcode_settings[configname].items():
if key not in result:
continue
elif result[key] != value:
@@ -1017,8 +1019,8 @@ class XcodeSettings(object):
unimpl = ['OTHER_CODE_SIGN_FLAGS']
unimpl = set(unimpl) & set(self.xcode_settings[configname].keys())
if unimpl:
- print 'Warning: Some codesign keys not implemented, ignoring: %s' % (
- ', '.join(sorted(unimpl)))
+ print('Warning: Some codesign keys not implemented, ignoring: %s' % (
+ ', '.join(sorted(unimpl))))
return ['%s code-sign-bundle "%s" "%s" "%s"' % (
os.path.join('${TARGET_BUILD_DIR}', 'gyp-mac-tool'), key,
@@ -1621,7 +1623,7 @@ def _TopologicallySortedEnvVarKeys(env):
order = gyp.common.TopologicallySorted(env.keys(), GetEdges)
order.reverse()
return order
- except gyp.common.CycleError, e:
+ except gyp.common.CycleError as e:
raise GypError(
'Xcode environment variables are cyclically dependent: ' + str(e.nodes))
@@ -1658,10 +1660,10 @@ def _HasIOSTarget(targets):
def _AddIOSDeviceConfigurations(targets):
"""Clone all targets and append -iphoneos to the name. Configure these targets
to build for iOS devices and use correct architectures for those builds."""
- for target_dict in targets.itervalues():
+ for target_dict in targets.values():
toolset = target_dict['toolset']
configs = target_dict['configurations']
- for config_name, config_dict in dict(configs).iteritems():
+ for config_name, config_dict in dict(configs).items():
iphoneos_config_dict = copy.deepcopy(config_dict)
configs[config_name + '-iphoneos'] = iphoneos_config_dict
configs[config_name + '-iphonesimulator'] = config_dict

Powered by Google App Engine
This is Rietveld 408576698