Skip to content

Commit

Permalink
Dev: migrate to Python3
Browse files Browse the repository at this point in the history
  • Loading branch information
andriydruk committed Oct 20, 2023
1 parent 708b04a commit 792434e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion build/macOS/000-install-dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ brew install coreutils cmake ninja pkg-config

# Prepare Python
python --version
curl https://bootstrap.pypa.io/pip/2.7/get-pip.py -o get-pip.py
curl https://bootstrap.pypa.io/pip/get-pip.py -o get-pip.py
python get-pip.py
pip install six

Expand Down
10 changes: 5 additions & 5 deletions src/tools/bin/swift-android
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#!/usr/bin/env python
from __future__ import print_function
#!/usr/bin/env python3

import os
import sys
Expand Down Expand Up @@ -40,7 +39,7 @@ def link(version):

try:
os.symlink(src, dst)
except OSError, e:
except OSError as e:
if e.errno == errno.EEXIST:
os.remove(dst)
os.symlink(src, dst)
Expand All @@ -63,7 +62,7 @@ def most_recent_version(versions):

return matches.group("version")

versions = filter(lambda v: v is not None, map(map_versions, versions))
versions = [v for v in map(map_versions, versions) if v is not None]

def tools_version_predicate(version):
try:
Expand All @@ -72,7 +71,7 @@ def most_recent_version(versions):
except:
return False

filtered = filter(tools_version_predicate, versions)
filtered = list(filter(tools_version_predicate, versions))
ranged = sorted(filtered, key=StrictVersion)

if len(ranged) == 0:
Expand Down Expand Up @@ -205,3 +204,4 @@ if __name__ == "__main__":
update(args.update_to)
elif not args.select_version is None:
select_version(args.select_version)

0 comments on commit 792434e

Please sign in to comment.