mirror of
https://github.com/python/cpython.git
synced 2025-07-19 17:25:54 +00:00
gh-119132: Update sys.version to identify free-threaded or not. (gh-119134)
This commit is contained in:
parent
691429702f
commit
c141d43937
3 changed files with 24 additions and 11 deletions
|
@ -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());
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue