1
- #!/usr/bin/env python3
1
+ #!/usr/bin/env python
2
2
3
3
# This source file is part of the Swift.org open source project
4
4
#
8
8
# See https://swift.org/LICENSE.txt for license information
9
9
# See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
10
10
11
+
11
12
"""
12
13
The ultimate tool for building Swift.
13
14
"""
14
15
16
+
17
+ from __future__ import absolute_import , print_function , unicode_literals
18
+
15
19
import json
16
20
import os
17
21
import platform
@@ -28,6 +32,8 @@ from build_swift.build_swift.constants import SWIFT_BUILD_ROOT
28
32
from build_swift .build_swift .constants import SWIFT_REPO_NAME
29
33
from build_swift .build_swift .constants import SWIFT_SOURCE_ROOT
30
34
35
+ import six
36
+
31
37
from swift_build_support .swift_build_support import build_script_invocation
32
38
from swift_build_support .swift_build_support import shell
33
39
from swift_build_support .swift_build_support import targets
@@ -113,7 +119,7 @@ class JSONDumper(json.JSONEncoder):
113
119
def default (self , o ):
114
120
if hasattr (o , '__dict__' ):
115
121
return vars (o )
116
- return str (o )
122
+ return six . text_type (o )
117
123
118
124
119
125
def print_xcodebuild_versions (file = sys .stdout ):
@@ -500,7 +506,7 @@ def main_preset():
500
506
try :
501
507
preset_parser .read_files (args .preset_file_names )
502
508
except presets .PresetError as e :
503
- fatal_error (str (e ))
509
+ fatal_error (six . text_type (e ))
504
510
505
511
if args .show_presets :
506
512
for name in sorted (preset_parser .preset_names ,
@@ -521,7 +527,7 @@ def main_preset():
521
527
args .preset ,
522
528
vars = args .preset_substitutions )
523
529
except presets .PresetError as e :
524
- fatal_error (str (e ))
530
+ fatal_error (six . text_type (e ))
525
531
526
532
preset_args = migration .migrate_swift_sdks (preset .args )
527
533
0 commit comments