Skip to content

Commit 26bdfa2

Browse files
committed
Drop python3 support in emsdk.py
Fixes: #1592
1 parent 44f11ea commit 26bdfa2

File tree

3 files changed

+13
-32
lines changed

3 files changed

+13
-32
lines changed

.circleci/config.yml

Lines changed: 5 additions & 16 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: |
@@ -138,22 +131,18 @@ jobs:
138131
name: win/server-2019
139132
shell: bash.exe
140133
environment:
141-
# We need python installed before we can test anytyhing.
142-
# There seems to be undocument copy of python installed here. Hopefully
143-
# if this disappears there will be another way of getting a re-installed
144-
# version.
145-
PYTHON_BIN: "C:\\Python27amd64"
146134
PYTHONUNBUFFERED: "1"
147135
EMSDK_NOTTY: "1"
148136
steps:
149137
- checkout
150-
- run:
151-
name: Add python to bash path
152-
command: echo "export PATH=\"$PATH:/c/python27amd64/\"" >> $BASH_ENV
138+
- run: where python
139+
- run: where python3
140+
153141
- run:
154142
name: Install latest
155143
shell: cmd.exe
156144
command: test\test.bat
145+
157146
- run:
158147
name: test.py
159148
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

test/test.bat

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
:: equivalent of test.sh as windows bat file
2-
set PATH=%PATH%;%PYTHON_BIN%
32
CALL emsdk install latest
43
CALL emsdk activate latest
54
CALL emsdk_env.bat

0 commit comments

Comments
 (0)