Branch data Line data Source code
1 : : 2 : : /* Return the full version string. */ 3 : : 4 : : #include "Python.h" 5 : : 6 : : #include "patchlevel.h" 7 : : 8 : : static int initialized = 0; 9 : : static char version[250]; 10 : : 11 : 58 : void _Py_InitVersion(void) 12 : : { 13 [ + + ]: 58 : if (initialized) { 14 : 29 : return; 15 : : } 16 : 29 : initialized = 1; 17 : 29 : PyOS_snprintf(version, sizeof(version), "%.80s (%.80s) %.80s", 18 : : PY_VERSION, Py_GetBuildInfo(), Py_GetCompiler()); 19 : : } 20 : : 21 : : const char * 22 : 29 : Py_GetVersion(void) 23 : : { 24 : 29 : _Py_InitVersion(); 25 : 29 : return version; 26 : : } 27 : : 28 : : // Export the Python hex version as a constant. 29 : : const unsigned long Py_Version = PY_VERSION_HEX;