From c0e6f90652aae9b4871dcd34f07ef28568e81bdc Mon Sep 17 00:00:00 2001 From: Jason Simmons Date: Fri, 7 Mar 2025 20:54:09 +0000 Subject: [PATCH] Use Python 3.12 to run the yapf formatter if no lower version is available (#164807) Python 3.12 still provides the dependencies required by yapf (such as lib2to3) --- engine/src/flutter/tools/yapf.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/engine/src/flutter/tools/yapf.sh b/engine/src/flutter/tools/yapf.sh index ce65115297..6fab3445fc 100755 --- a/engine/src/flutter/tools/yapf.sh +++ b/engine/src/flutter/tools/yapf.sh @@ -43,12 +43,14 @@ if command -v python3.10 &> /dev/null; then PYTHON_EXEC="python3.10" elif command -v python3.11 &> /dev/null; then PYTHON_EXEC="python3.11" +elif command -v python3.12 &> /dev/null; then + PYTHON_EXEC="python3.12" else python3 -c " import sys version = sys.version_info -if (version.major, version.minor) > (3, 11): - print(f'Error: The yapf Python formatter requires Python version 3.11 or ' +if (version.major, version.minor) > (3, 12): + print(f'Error: The yapf Python formatter requires Python version 3.12 or ' f'earlier. The installed python3 version is ' f'{version.major}.{version.minor}.', file=sys.stderr)