Skip to content

Commit bfed914

Browse files
authored
Check for supported Python versions
1 parent 867d3d1 commit bfed914

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

platform.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,19 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15+
# Python Version Check
16+
import sys
17+
18+
if not ((3, 10) <= sys.version_info < (3, 14)):
19+
print("ERROR: Python version must be between 3.10 and 3.13.", file=sys.stderr)
20+
print(f"Current Python version: {sys.version_info.major}.{sys.version_info.minor}.{sys.version_info.micro}", file=sys.stderr)
21+
print("Supported versions: 3.10, 3.11, 3.12, 3.13", file=sys.stderr)
22+
raise SystemExit(1)
23+
1524
# LZMA support check
1625
try:
1726
import lzma as _lzma
1827
except ImportError:
19-
import sys
2028
print("ERROR: Python's lzma module is unavailable or broken in this interpreter.", file=sys.stderr)
2129
print("LZMA (liblzma) support is required for tool/toolchain installation.", file=sys.stderr)
2230
print("Please install Python built with LZMA support.", file=sys.stderr)
@@ -34,7 +42,6 @@
3442
import shutil
3543
import socket
3644
import subprocess
37-
import sys
3845
from pathlib import Path
3946
from typing import Optional, Dict, List, Any, Union
4047

0 commit comments

Comments
 (0)