Mercurial > cpython-lru_cache-weakref
comparison Python/sysmodule.c @ 14295:e5253b692e9f legacy-trunk
_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.
| author | Fred Drake <fdrake@acm.org> |
|---|---|
| date | Thu, 31 Aug 2000 15:21:11 +0000 |
| parents | 128f641191c3 |
| children | b8b3f76ffd51 |
comparison
equal
deleted
inserted
replaced
| 14294:053627e7ac14 | 14295:e5253b692e9f |
|---|---|
| 418 * These release level checks are mutually exclusive and cover | 418 * These release level checks are mutually exclusive and cover |
| 419 * the field, so don't get too fancy with the pre-processor! | 419 * the field, so don't get too fancy with the pre-processor! |
| 420 */ | 420 */ |
| 421 #if PY_RELEASE_LEVEL == PY_RELEASE_LEVEL_ALPHA | 421 #if PY_RELEASE_LEVEL == PY_RELEASE_LEVEL_ALPHA |
| 422 s = "alpha"; | 422 s = "alpha"; |
| 423 #endif | 423 #elif PY_RELEASE_LEVEL == PY_RELEASE_LEVEL_BETA |
| 424 #if PY_RELEASE_LEVEL == PY_RELEASE_LEVEL_BETA | |
| 425 s = "beta"; | 424 s = "beta"; |
| 426 #endif | 425 #elif PY_RELEASE_LEVEL == PY_RELEASE_LEVEL_GAMMA |
| 427 #if PY_RELEASE_LEVEL == PY_RELEASE_LEVEL_GAMMA | |
| 428 s = "candidate"; | 426 s = "candidate"; |
| 429 #endif | 427 #elif PY_RELEASE_LEVEL == PY_RELEASE_LEVEL_FINAL |
| 430 #if PY_RELEASE_LEVEL == PY_RELEASE_LEVEL_FINAL | |
| 431 s = "final"; | 428 s = "final"; |
| 432 #endif | 429 #endif |
| 433 PyDict_SetItemString(sysdict, "version_info", | 430 PyDict_SetItemString(sysdict, "version_info", |
| 434 v = Py_BuildValue("iiisi", PY_MAJOR_VERSION, | 431 v = Py_BuildValue("iiisi", PY_MAJOR_VERSION, |
| 435 PY_MINOR_VERSION, | 432 PY_MINOR_VERSION, |
