diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2024-05-18 20:49:11 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-18 20:49:11 (GMT) |
commit | ec88e9f686a97a7dfc3c2ef28a244e53d313731a (patch) | |
tree | 2bc625d27cbe5c9bdfa652786edefc6d27276108 /Python | |
parent | 641e59db59a0d1ad712b20948b19eec16a1f9a84 (diff) | |
download | cpython-ec88e9f686a97a7dfc3c2ef28a244e53d313731a.zip cpython-ec88e9f686a97a7dfc3c2ef28a244e53d313731a.tar.gz cpython-ec88e9f686a97a7dfc3c2ef28a244e53d313731a.tar.bz2 |
[3.13] gh-119132: Update sys.version to identify free-threaded or not. (gh-119134) (#119153)
gh-119132: Update sys.version to identify free-threaded or not. (gh-119134)
(cherry picked from commit c141d4393750c827cbcb3867f0f42997a3bb3528)
Co-authored-by: Donghee Na <donghee.na@python.org>
Diffstat (limited to 'Python')
-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()); } |