Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update min python version from 3.6 to 3.8 #23417

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ See docs/process.md for more on how version tagging works.
a conflict between the `majorVersion` requested and the WebGL support defined
via linker flags (`MIN_WEBGL_VERSION` and `MAX_WEBGL_VERSION`). This warning
will be turned into a hard failure in a future release. (#23372, #23416)
- The version of python required to run emscripten was bumped from 3.6 to 3.8.
(#23417)

4.0.0 - 01/14/25
----------------
Expand Down
13 changes: 1 addition & 12 deletions tools/building.py
Original file line number Diff line number Diff line change
Expand Up @@ -476,17 +476,6 @@ def check_closure_compiler(cmd, args, env, allowed_to_fail):
return True


# Remove this once we require python3.7 and can use std.isascii.
# See: https://docs.python.org/3/library/stdtypes.html#str.isascii
def isascii(s):
try:
s.encode('ascii')
except UnicodeEncodeError:
return False
else:
return True


def get_closure_compiler_and_env(user_args):
env = shared.env_with_node_in_path()
closure_cmd = get_closure_compiler()
Expand Down Expand Up @@ -623,7 +612,7 @@ def run_closure_cmd(cmd, filename, env):
tempfiles = shared.get_temp_files()

def move_to_safe_7bit_ascii_filename(filename):
if isascii(filename):
if filename.isascii():
return os.path.abspath(filename)
safe_filename = tempfiles.get('.js').name # Safe 7-bit filename
shutil.copyfile(filename, safe_filename)
Expand Down
6 changes: 3 additions & 3 deletions tools/shared.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@
import sys
import tempfile

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

from . import colored_logger
Expand Down
11 changes: 1 addition & 10 deletions tools/system_libs.py
Original file line number Diff line number Diff line change
Expand Up @@ -2435,17 +2435,8 @@ def calculate(args):
return ret


# Once we require python 3.8 we can use shutil.copytree with
# dirs_exist_ok=True and remove this function.
def copytree_exist_ok(src, dst):
os.makedirs(dst, exist_ok=True)
for entry in os.scandir(src):
srcname = os.path.join(src, entry.name)
dstname = os.path.join(dst, entry.name)
if entry.is_dir():
copytree_exist_ok(srcname, dstname)
else:
shared.safe_copy(srcname, dstname)
shutil.copytree(src, dst, dirs_exist_ok=True)


def install_system_headers(stamp):
Expand Down
Loading