Permalink
Cannot retrieve contributors at this time
29 lines (22 sloc)
552 Bytes
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
cpython/Python/getversion.c
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* 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; |