diff options
author | Fred Drake <fdrake@acm.org> | 2000-04-13 20:03:20 (GMT) |
---|---|---|
committer | Fred Drake <fdrake@acm.org> | 2000-04-13 20:03:20 (GMT) |
commit | 6d27c1eb328bc9ea27a90d136b1c772271c4bec0 (patch) | |
tree | 02494134efd05bc41099bad73a198c9f1b24f2f4 /Python | |
parent | 9cf7587fdc7821e418a63da3ad40ddb58c5b4ba6 (diff) | |
download | cpython-6d27c1eb328bc9ea27a90d136b1c772271c4bec0.zip cpython-6d27c1eb328bc9ea27a90d136b1c772271c4bec0.tar.gz cpython-6d27c1eb328bc9ea27a90d136b1c772271c4bec0.tar.bz2 |
Simplify creation of the version_info value for clarity, per
suggestion from Greg Stein.
Diffstat (limited to 'Python')
-rw-r--r-- | Python/sysmodule.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/Python/sysmodule.c b/Python/sysmodule.c index e7c0d48..34f7c96 100644 --- a/Python/sysmodule.c +++ b/Python/sysmodule.c @@ -383,6 +383,7 @@ _PySys_Init() 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 @@ _PySys_Init() * 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", |