summaryrefslogtreecommitdiffstats
path: root/Python/getversion.c
diff options
context:
space:
mode:
authorDonghee Na <donghee.na@python.org>2024-05-18 19:44:40 (GMT)
committerGitHub <noreply@github.com>2024-05-18 19:44:40 (GMT)
commitc141d4393750c827cbcb3867f0f42997a3bb3528 (patch)
tree6560efcff1fa27b3e6c5b85acadedf4736050c16 /Python/getversion.c
parent691429702f1cb657e65f4e5275bb5ed16121d2b7 (diff)
downloadcpython-c141d4393750c827cbcb3867f0f42997a3bb3528.zip
cpython-c141d4393750c827cbcb3867f0f42997a3bb3528.tar.gz
cpython-c141d4393750c827cbcb3867f0f42997a3bb3528.tar.bz2
gh-119132: Update sys.version to identify free-threaded or not. (gh-119134)
Diffstat (limited to 'Python/getversion.c')
-rw-r--r--Python/getversion.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/Python/getversion.c b/Python/getversion.c
index 5db836a..226b2f9 100644
--- a/Python/getversion.c
+++ b/Python/getversion.c
@@ -6,7 +6,7 @@
#include "patchlevel.h"
static int initialized = 0;
-static char version[250];
+static char version[300];
void _Py_InitVersion(void)
{
@@ -14,7 +14,12 @@ void _Py_InitVersion(void)
return;
}
initialized = 1;
- PyOS_snprintf(version, sizeof(version), "%.80s (%.80s) %.80s",
+#ifdef Py_GIL_DISABLED
+ const char *buildinfo_format = "%.80s experimental free-threading build (%.80s) %.80s";
+#else
+ const char *buildinfo_format = "%.80s (%.80s) %.80s";
+#endif
+ PyOS_snprintf(version, sizeof(version), buildinfo_format,
PY_VERSION, Py_GetBuildInfo(), Py_GetCompiler());
}