Skip to content

Commit 3d892c1

Browse files
committed
Updated support prompt to indicate free-threaded builds, and GIL status on free-threaded builds
1 parent 94370b6 commit 3d892c1

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

src_py/__init__.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -399,9 +399,20 @@ def __color_reduce(c):
399399
copyreg.pickle(Color, __color_reduce, __color_constructor)
400400

401401
if "PYGAME_HIDE_SUPPORT_PROMPT" not in os.environ:
402+
python_implementation = sys.version
403+
python_version = platform.python_version()
404+
from packaging import version
405+
406+
if (
407+
sys.platform not in ("wasi", "wasm")
408+
and (version.parse(python_version) >= version.parse("3.13.0"))
409+
and "free-threading" in python_implementation
410+
):
411+
python_version += f"t, {'' if sys._is_gil_enabled() else 'No '}GIL"
412+
402413
print(
403414
f"pygame-ce {ver} (SDL {'.'.join(map(str, get_sdl_version()))}, "
404-
f"Python {platform.python_version()})"
415+
f"Python {python_version})"
405416
)
406417

407418
# cleanup namespace

0 commit comments

Comments
 (0)