Commit 592f2d6c authored by Fred Drake's avatar Fred Drake

_PySys_Init(): When setting up sys.version_info, use #if/#elif.../#endif

                instead of four #if/#endif blocks.  This shortens the
                code and improves readability.
parent 0625777b
......@@ -420,14 +420,11 @@ _PySys_Init(void)
*/
#if PY_RELEASE_LEVEL == PY_RELEASE_LEVEL_ALPHA
s = "alpha";
#endif
#if PY_RELEASE_LEVEL == PY_RELEASE_LEVEL_BETA
#elif PY_RELEASE_LEVEL == PY_RELEASE_LEVEL_BETA
s = "beta";
#endif
#if PY_RELEASE_LEVEL == PY_RELEASE_LEVEL_GAMMA
#elif PY_RELEASE_LEVEL == PY_RELEASE_LEVEL_GAMMA
s = "candidate";
#endif
#if PY_RELEASE_LEVEL == PY_RELEASE_LEVEL_FINAL
#elif PY_RELEASE_LEVEL == PY_RELEASE_LEVEL_FINAL
s = "final";
#endif
PyDict_SetItemString(sysdict, "version_info",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment