Skip to content

Commit ad713f4

Browse files
authored
Merge pull request #4 from onion108/master
Upgrade to Python 3
2 parents 2fb80c5 + 61c6865 commit ad713f4

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

longest.py

+9-8
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,16 @@
99

1010

1111
def usage():
12-
print 'Usage: python', sys.argv[0], '<platform>'
13-
print '<platform> may be iPhoneOS, MacOSX or WatchOS'
12+
print('Usage: python', sys.argv[0], '<platform>')
13+
print('<platform> may be iPhoneOS, MacOSX or WatchOS')
1414

1515

1616
def outputLongestNames(title, names):
17-
print 'Longest', title
18-
print '----------------'
17+
print('Longest', title)
18+
print('----------------')
1919
names = sorted(names, key=lambda item: len(item), reverse=True)
2020
for name in names[:NAME_LIMIT]:
21-
print '* [%02d] %s' % (len(name), name)
21+
print('* [%02d] %s' % (len(name), name))
2222
print
2323

2424

@@ -40,12 +40,12 @@ def outputLongestNames(title, names):
4040

4141
platform_name, arch = platform_map[plat]
4242

43-
print 'Longest Names For', platform_name, arch
44-
print '================'
43+
print('Longest Names For', platform_name, arch)
44+
print('================')
4545
print
4646

4747
# SDK and frameworks root dir
48-
sdk_root = subprocess.check_output(['xcrun', '--sdk', plat, '--show-sdk-path']).strip()
48+
sdk_root = subprocess.check_output(['xcrun', '--sdk', plat, '--show-sdk-path']).decode("utf-8").strip()
4949
frameworks_root = os.path.join(sdk_root, 'System/Library/Frameworks')
5050

5151
# Import all frameworks in one .h file
@@ -76,6 +76,7 @@ def outputLongestNames(title, names):
7676
stderr=FNULL)
7777

7878
ast, _ = p.communicate()
79+
ast = ast.decode("utf-8")
7980
os.remove(import_filename)
8081

8182
# Remove console color codes

0 commit comments

Comments
 (0)