Skip to content

Commit 93555b1

Browse files
committed
Swap out sys.version for sysconfig.get_config_var
1 parent e358e77 commit 93555b1

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src_py/__init__.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -399,21 +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-
python_implementation = sys.version
402+
import sysconfig
403+
403404
python_version = platform.python_version()
404405

405406
if (
406407
sys.platform not in ("wasi", "wasm")
407408
and (sys.version_info >= (3, 13, 0))
408-
and "free-threading" in python_implementation
409+
and sysconfig.get_config_var("Py_GIL_DISABLED")
409410
):
410411
python_version += f"t, {'' if sys._is_gil_enabled() else 'No '}GIL"
411412

412413
print(
413414
f"pygame-ce {ver} (SDL {'.'.join(map(str, get_sdl_version()))}, "
414415
f"Python {python_version})"
415416
)
416-
del python_version, python_implementation
417+
del python_version, sysconfig
417418

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

0 commit comments

Comments
 (0)