Mercurial > cpython-lru_cache-weakref
diff Python/sysmodule.c @ 12398:2392d10e21f1 legacy-trunk
Simplify creation of the version_info value for clarity, per
suggestion from Greg Stein.
| author | Fred Drake <fdrake@acm.org> |
|---|---|
| date | Thu, 13 Apr 2000 20:03:20 +0000 |
| parents | f82b2577fa0c |
| children | c92668766f5d |
line wrap: on
line diff
--- a/Python/sysmodule.c Thu Apr 13 17:51:58 2000 +0000 +++ b/Python/sysmodule.c Thu Apr 13 20:03:20 2000 +0000 @@ -383,6 +383,7 @@ extern int fclose Py_PROTO((FILE *)); PyObject *m, *v, *sysdict; PyObject *sysin, *sysout, *syserr; + char *s; m = Py_InitModule3("sys", sys_methods, sys_doc); sysdict = PyModule_GetDict(m); @@ -413,21 +414,21 @@ * the field, so don't get too fancy with the pre-processor! */ #if PY_RELEASE_LEVEL == PY_RELEASE_LEVEL_ALPHA - v = PyString_FromString("alpha"); + s = "alpha"; #endif #if PY_RELEASE_LEVEL == PY_RELEASE_LEVEL_BETA - v = PyString_FromString("beta"); + s = "beta"; #endif #if PY_RELEASE_LEVEL == PY_RELEASE_LEVEL_GAMMA - v = PyString_FromString("candidate"); + s = "candidate"; #endif #if PY_RELEASE_LEVEL == PY_RELEASE_LEVEL_FINAL - v = PyString_FromString("final"); + s = "final"; #endif PyDict_SetItemString(sysdict, "version_info", - v = Py_BuildValue("iiiNi", PY_MAJOR_VERSION, + v = Py_BuildValue("iiisi", PY_MAJOR_VERSION, PY_MINOR_VERSION, - PY_MICRO_VERSION, v, + PY_MICRO_VERSION, s, PY_RELEASE_SERIAL)); Py_XDECREF(v); PyDict_SetItemString(sysdict, "copyright",
