mirror of
https://github.com/python/cpython.git
synced 2025-08-22 09:45:06 +00:00
gh-81057: Move Globals in Core Code to _PyRuntimeState (gh-99496)
This is the first of several changes to consolidate non-object globals in core code. https://github.com/python/cpython/issues/81057
This commit is contained in:
parent
73943cbc4c
commit
3c57971a2d
17 changed files with 235 additions and 167 deletions
|
@ -5,12 +5,23 @@
|
|||
|
||||
#include "patchlevel.h"
|
||||
|
||||
static int initialized = 0;
|
||||
static char version[250];
|
||||
|
||||
void _Py_InitVersion(void)
|
||||
{
|
||||
if (initialized) {
|
||||
return;
|
||||
}
|
||||
initialized = 1;
|
||||
PyOS_snprintf(version, sizeof(version), "%.80s (%.80s) %.80s",
|
||||
PY_VERSION, Py_GetBuildInfo(), Py_GetCompiler());
|
||||
}
|
||||
|
||||
const char *
|
||||
Py_GetVersion(void)
|
||||
{
|
||||
static char version[250];
|
||||
PyOS_snprintf(version, sizeof(version), "%.80s (%.80s) %.80s",
|
||||
PY_VERSION, Py_GetBuildInfo(), Py_GetCompiler());
|
||||
_Py_InitVersion();
|
||||
return version;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue