diff options
author | Donghee Na <donghee.na@python.org> | 2024-05-18 19:44:40 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-18 19:44:40 (GMT) |
commit | c141d4393750c827cbcb3867f0f42997a3bb3528 (patch) | |
tree | 6560efcff1fa27b3e6c5b85acadedf4736050c16 /Python/getversion.c | |
parent | 691429702f1cb657e65f4e5275bb5ed16121d2b7 (diff) | |
download | cpython-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.c | 9 |
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()); } |