Skip to content

Commit c0e6f90

Browse files
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)
1 parent 647e5a1 commit c0e6f90

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

engine/src/flutter/tools/yapf.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,14 @@ if command -v python3.10 &> /dev/null; then
4343
PYTHON_EXEC="python3.10"
4444
elif command -v python3.11 &> /dev/null; then
4545
PYTHON_EXEC="python3.11"
46+
elif command -v python3.12 &> /dev/null; then
47+
PYTHON_EXEC="python3.12"
4648
else
4749
python3 -c "
4850
import sys
4951
version = sys.version_info
50-
if (version.major, version.minor) > (3, 11):
51-
print(f'Error: The yapf Python formatter requires Python version 3.11 or '
52+
if (version.major, version.minor) > (3, 12):
53+
print(f'Error: The yapf Python formatter requires Python version 3.12 or '
5254
f'earlier. The installed python3 version is '
5355
f'{version.major}.{version.minor}.',
5456
file=sys.stderr)

0 commit comments

Comments
 (0)