Skip to content

Commit dcd910a

Browse files
authored
Merge pull request #3554 from oddbookworm/update-prompt-with-freethreading-info
Support prompts indicate freethreaded build status
2 parents d6459ad + 621260e commit dcd910a

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

src_py/__init__.py

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

401401
if "PYGAME_HIDE_SUPPORT_PROMPT" not in os.environ:
402+
import sysconfig
403+
404+
python_version = platform.python_version()
405+
406+
if (
407+
sys.platform not in ("wasi", "emscripten")
408+
and (sys.version_info >= (3, 13, 0))
409+
and sysconfig.get_config_var("Py_GIL_DISABLED")
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
)
417+
del python_version, sysconfig
406418

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

0 commit comments

Comments
 (0)