]> granicus.if.org Git - python/commitdiff
_PySys_Init(): When setting up sys.version_info, use #if/#elif.../#endif
authorFred Drake <fdrake@acm.org>
Thu, 31 Aug 2000 15:21:11 +0000 (15:21 +0000)
committerFred Drake <fdrake@acm.org>
Thu, 31 Aug 2000 15:21:11 +0000 (15:21 +0000)
                instead of four #if/#endif blocks.  This shortens the
                code and improves readability.

Python/sysmodule.c

index 51a85e0a5dddf50092f23944edae2dca9542a227..d500a364719867f5c35f3007c42fc9c59ec8ab98 100644 (file)
@@ -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",