Skip to content

Commit f3ea577

Browse files
committed
Drop python 2 support in emsdk.py
Fixes: #1592
1 parent 2b10b1b commit f3ea577

File tree

2 files changed

+9
-23
lines changed

2 files changed

+9
-23
lines changed

.circleci/config.yml

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -81,14 +81,7 @@ jobs:
8181
name: install python deps
8282
command: |
8383
apt-get update -q
84-
apt-get install -q -y python2 python3-pip
85-
- run:
86-
name: python2 flake8
87-
command: |
88-
curl https://bootstrap.pypa.io/pip/2.7/get-pip.py --output get-pip.py
89-
python2 get-pip.py
90-
python2 -m pip install flake8==3.9.2
91-
python2 -m flake8 --show-source --statistics --extend-exclude=./scripts
84+
apt-get install -q -y python3-pip
9285
- run:
9386
name: python3 flake8
9487
command: |

emsdk.py

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
1-
#!/usr/bin/env python
1+
#!/usr/bin/env python3
22
# Copyright 2019 The Emscripten Authors. All rights reserved.
33
# Emscripten is available under two separate licenses, the MIT license and the
44
# University of Illinois/NCSA Open Source License. Both these licenses can be
55
# found in the LICENSE file.
66

7-
from __future__ import print_function
8-
97
import copy
108
from collections import OrderedDict
119
import errno
@@ -22,21 +20,16 @@
2220
import sysconfig
2321
import zipfile
2422
if os.name == 'nt':
25-
try:
26-
import winreg
27-
except ImportError:
28-
# old python 2 name
29-
import _winreg as winreg
23+
import winreg
3024
import ctypes.wintypes
3125

32-
if sys.version_info >= (3,):
33-
from urllib.parse import urljoin
34-
from urllib.request import urlopen
35-
import functools
36-
else:
37-
from urlparse import urljoin
38-
from urllib2 import urlopen
26+
from urllib.parse import urljoin
27+
from urllib.request import urlopen
28+
import functools
3929

30+
if sys.version_info < (3, 0):
31+
print(f'error: emsdk requires python 3.0 or above ({sys.executable} {sys.version})', file=sys.stderr)
32+
sys.exit(1)
4033

4134
emsdk_packages_url = 'https://storage.googleapis.com/webassembly/emscripten-releases-builds/deps/'
4235

0 commit comments

Comments
 (0)