diff --git a/Misc/NEWS.d/next/Build/2024-05-18-10-18-16.gh-issue-119132.mQ0XKg.rst b/Misc/NEWS.d/next/Build/2024-05-18-10-18-16.gh-issue-119132.mQ0XKg.rst new file mode 100644 index 00000000000000..87d80a290e5095 --- /dev/null +++ b/Misc/NEWS.d/next/Build/2024-05-18-10-18-16.gh-issue-119132.mQ0XKg.rst @@ -0,0 +1,2 @@ +python -VV now display whether it is the free-threaded or not. Patch By +Donghee Na. diff --git a/Python/initconfig.c b/Python/initconfig.c index a28c08c5318ddc..a9875d6d42818d 100644 --- a/Python/initconfig.c +++ b/Python/initconfig.c @@ -2596,8 +2596,13 @@ config_parse_cmdline(PyConfig *config, PyWideStringList *warnoptions, } while (1); if (print_version) { - printf("Python %s\n", - (print_version >= 2) ? Py_GetVersion() : PY_VERSION); + const char *version; + version = (print_version >= 2) ? Py_GetVersion() : PY_VERSION; +#ifdef Py_GIL_DISABLED + printf("Python %s free-threading\n", version); +#else + printf("Python %s\n", version); +#endif return _PyStatus_EXIT(0); }