Skip to content

Commit 7b15c04

Browse files
committed
Use meets_python_minimum_version for free-threaded safety check
1 parent 7162966 commit 7b15c04

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

cpython-unix/build-main.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
import subprocess
1212
import sys
1313

14+
from pythonbuild.cpython import meets_python_minimum_version
1415
from pythonbuild.downloads import DOWNLOADS
1516
from pythonbuild.utils import (
1617
compress_python_archive,
@@ -165,7 +166,9 @@ def main():
165166
release_tag = release_tag_from_git()
166167

167168
# Guard against accidental misuse of the free-threaded flag with older versions
168-
if "freethreaded" in args.options and python_majmin not in ("3.13", "3.14"):
169+
if "freethreaded" in args.options and not meets_python_minimum_version(
170+
python_majmin, "3.13"
171+
):
169172
print(
170173
"Invalid build option: 'freethreaded' is only compatible with CPython 3.13+ (got %s)"
171174
% cpython_version

0 commit comments

Comments
 (0)