Skip to content

Commit 465f969

Browse files
authored
Revert "build-swift: Explicitly use python3"
1 parent 1b42953 commit 465f969

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

utils/build-script

+10-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/env python3
1+
#!/usr/bin/env python
22

33
# This source file is part of the Swift.org open source project
44
#
@@ -8,10 +8,14 @@
88
# See https://swift.org/LICENSE.txt for license information
99
# See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
1010

11+
1112
"""
1213
The ultimate tool for building Swift.
1314
"""
1415

16+
17+
from __future__ import absolute_import, print_function, unicode_literals
18+
1519
import json
1620
import os
1721
import platform
@@ -28,6 +32,8 @@ from build_swift.build_swift.constants import SWIFT_BUILD_ROOT
2832
from build_swift.build_swift.constants import SWIFT_REPO_NAME
2933
from build_swift.build_swift.constants import SWIFT_SOURCE_ROOT
3034

35+
import six
36+
3137
from swift_build_support.swift_build_support import build_script_invocation
3238
from swift_build_support.swift_build_support import shell
3339
from swift_build_support.swift_build_support import targets
@@ -113,7 +119,7 @@ class JSONDumper(json.JSONEncoder):
113119
def default(self, o):
114120
if hasattr(o, '__dict__'):
115121
return vars(o)
116-
return str(o)
122+
return six.text_type(o)
117123

118124

119125
def print_xcodebuild_versions(file=sys.stdout):
@@ -500,7 +506,7 @@ def main_preset():
500506
try:
501507
preset_parser.read_files(args.preset_file_names)
502508
except presets.PresetError as e:
503-
fatal_error(str(e))
509+
fatal_error(six.text_type(e))
504510

505511
if args.show_presets:
506512
for name in sorted(preset_parser.preset_names,
@@ -521,7 +527,7 @@ def main_preset():
521527
args.preset,
522528
vars=args.preset_substitutions)
523529
except presets.PresetError as e:
524-
fatal_error(str(e))
530+
fatal_error(six.text_type(e))
525531

526532
preset_args = migration.migrate_swift_sdks(preset.args)
527533

utils/swift_build_support/swift_build_support/productpipeline_list_builder.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ def infer(self):
141141

142142
# Filter out any of the pipelines that before inference were not
143143
# selected.
144-
enabled_pipeline = [p for p in pipeline if p is not None]
144+
enabled_pipeline = filter(lambda x: x is not None, pipeline)
145145

146146
if self.args.verbose_build:
147147
print("-- Build Graph Inference --")

0 commit comments

Comments
 (0)