Skip to content

Support prompts indicate freethreaded build status #3554

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion src_py/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -399,10 +399,21 @@ def __color_reduce(c):
copyreg.pickle(Color, __color_reduce, __color_constructor)

if "PYGAME_HIDE_SUPPORT_PROMPT" not in os.environ:
python_implementation = sys.version
python_version = platform.python_version()

if (
sys.platform not in ("wasi", "wasm")
and (sys.version_info >= (3, 13, 0))
and "free-threading" in python_implementation
Copy link
Member

@ankith26 ankith26 Aug 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The fact that this specific string is a substring of sys.version seems like an implementation detail. The docs even discourage extracting information out of sys.version.

A quick chatgpt tells me that sysconfig.get_config_var("Py_GIL_DISABLED") is an equivalent way to check for this, though we need to test it out.
UPDATE: On my Ubuntu 25.04 with python 3.13 this config var check is accurate.

):
python_version += f"t, {'' if sys._is_gil_enabled() else 'No '}GIL"

print(
f"pygame-ce {ver} (SDL {'.'.join(map(str, get_sdl_version()))}, "
f"Python {platform.python_version()})"
f"Python {python_version})"
)
del python_version, python_implementation

# cleanup namespace
del pygame, os, sys, platform, MissingModule, copyreg, packager_imports
Loading