Skip to content

Commit a8a2ffa

Browse files
committed
Update min python version from 3.6 to 3.8
The reason for picking 3.8 here is that it provides all the features we currently have need of, and it available in the places we care about: - debian/stable (bookworm): 3.11 - ubuntu/LTS (focal): 3.8 - emsdk: 3.9.2 Replaces: emscripten-core#23378 Fixes: emscripten-core#23387
1 parent bcad96d commit a8a2ffa

File tree

4 files changed

+7
-25
lines changed

4 files changed

+7
-25
lines changed

ChangeLog.md

+2
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ See docs/process.md for more on how version tagging works.
2323
- The minimum version of node required to run emscripten was bumped from v16.20
2424
to v18. Version 4.0 was mistakenly shipped with a change that required v20,
2525
but that was reverted. (#23410)
26+
- The version of python required to run emscripten was bumped from 3.6 to 3.8.
27+
(#23417)
2628

2729
4.0.0 - 01/14/25
2830
----------------

tools/building.py

+1-12
Original file line numberDiff line numberDiff line change
@@ -476,17 +476,6 @@ def check_closure_compiler(cmd, args, env, allowed_to_fail):
476476
return True
477477

478478

479-
# Remove this once we require python3.7 and can use std.isascii.
480-
# See: https://docs.python.org/3/library/stdtypes.html#str.isascii
481-
def isascii(s):
482-
try:
483-
s.encode('ascii')
484-
except UnicodeEncodeError:
485-
return False
486-
else:
487-
return True
488-
489-
490479
def get_closure_compiler_and_env(user_args):
491480
env = shared.env_with_node_in_path()
492481
closure_cmd = get_closure_compiler()
@@ -623,7 +612,7 @@ def run_closure_cmd(cmd, filename, env):
623612
tempfiles = shared.get_temp_files()
624613

625614
def move_to_safe_7bit_ascii_filename(filename):
626-
if isascii(filename):
615+
if filename.isascii():
627616
return os.path.abspath(filename)
628617
safe_filename = tempfiles.get('.js').name # Safe 7-bit filename
629618
shutil.copyfile(filename, safe_filename)

tools/shared.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@
2020
import sys
2121
import tempfile
2222

23-
# We depend on python 3.6 for fstring support
24-
if sys.version_info < (3, 6):
25-
print('error: emscripten requires python 3.6 or above', file=sys.stderr)
23+
# We depend on python 3.8 features
24+
if sys.version_info < (3, 8):
25+
print(f'error: emscripten requires python 3.8 or above ({sys.executable} {sys.version})', file=sys.stderr)
2626
sys.exit(1)
2727

2828
from . import colored_logger

tools/system_libs.py

+1-10
Original file line numberDiff line numberDiff line change
@@ -2442,17 +2442,8 @@ def calculate(args):
24422442
return ret
24432443

24442444

2445-
# Once we require python 3.8 we can use shutil.copytree with
2446-
# dirs_exist_ok=True and remove this function.
24472445
def copytree_exist_ok(src, dst):
2448-
os.makedirs(dst, exist_ok=True)
2449-
for entry in os.scandir(src):
2450-
srcname = os.path.join(src, entry.name)
2451-
dstname = os.path.join(dst, entry.name)
2452-
if entry.is_dir():
2453-
copytree_exist_ok(srcname, dstname)
2454-
else:
2455-
shared.safe_copy(srcname, dstname)
2446+
shutil.copytree(src, dst, dirs_exist_ok=True)
24562447

24572448

24582449
def install_system_headers(stamp):

0 commit comments

Comments
 (0)