Skip to content

Commit 3a2d670

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: #23378 Fixes: #23387
1 parent 797fcd9 commit 3a2d670

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
@@ -30,6 +30,8 @@ See docs/process.md for more on how version tagging works.
3030
a conflict between the `majorVersion` requested and the WebGL support defined
3131
via linker flags (`MIN_WEBGL_VERSION` and `MAX_WEBGL_VERSION`). This warning
3232
will be turned into a hard failure in a future release. (#23372, #23416)
33+
- The version of python required to run emscripten was bumped from 3.6 to 3.8.
34+
(#23417)
3335

3436
4.0.0 - 01/14/25
3537
----------------

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
@@ -2435,17 +2435,8 @@ def calculate(args):
24352435
return ret
24362436

24372437

2438-
# Once we require python 3.8 we can use shutil.copytree with
2439-
# dirs_exist_ok=True and remove this function.
24402438
def copytree_exist_ok(src, dst):
2441-
os.makedirs(dst, exist_ok=True)
2442-
for entry in os.scandir(src):
2443-
srcname = os.path.join(src, entry.name)
2444-
dstname = os.path.join(dst, entry.name)
2445-
if entry.is_dir():
2446-
copytree_exist_ok(srcname, dstname)
2447-
else:
2448-
shared.safe_copy(srcname, dstname)
2439+
shutil.copytree(src, dst, dirs_exist_ok=True)
24492440

24502441

24512442
def install_system_headers(stamp):

0 commit comments

Comments
 (0)