https://github.com/python/cpython
Raw File
Tip revision: f11d0d8be8af28e1368c3c7c116218cf65ddf93e authored by Erik Soma on 23 March 2024, 15:39:35 UTC
gh-91227: Ignore ERROR_PORT_UNREACHABLE in proactor recvfrom() (#32011)
Tip revision: f11d0d8
getversion.c

/* Return the full version string. */

#include "Python.h"

#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)
{
    _Py_InitVersion();
    return version;
}

// Export the Python hex version as a constant.
const unsigned long Py_Version = PY_VERSION_HEX;
back to top