[Python-checkins] CVS: python/dist/src/Python sysmodule.c,2.60,2.61
Fred Drake
python-dev@python.org
2000年4月13日 13:44:54 -0400
Update of /projects/cvsroot/python/dist/src/Python
In directory seahag.cnri.reston.va.us:/home/fdrake/projects/python/Python
Modified Files:
sysmodule.c
Log Message:
Capitulate, changing version_info to a 5-tuple:
major, minor, micro, level, serial
Values are now monotonically increasing with each new release.
Index: sysmodule.c
===================================================================
RCS file: /projects/cvsroot/python/dist/src/Python/sysmodule.c,v
retrieving revision 2.60
retrieving revision 2.61
diff -C2 -r2.60 -r2.61
*** sysmodule.c 2000年04月13日 15:29:10 2.60
--- sysmodule.c 2000年04月13日 17:44:51 2.61
***************
*** 409,427 ****
v = PyInt_FromLong(PY_VERSION_HEX));
Py_XDECREF(v);
#if PY_RELEASE_LEVEL == PY_RELEASE_LEVEL_FINAL
! v = PyString_FromStringAndSize(NULL, 0);
! #else
! {
! char buff[3];
! buff[0] = PY_RELEASE_LEVEL - PY_RELEASE_LEVEL_ALPHA + 'a';
! buff[1] = PY_RELEASE_SERIAL + '0';
! buff[2] = '0円';
! v = PyString_FromString(buff);
! }
! #endif /* PY_RELEASE_LEVEL == PY_RELEASE_LEVEL_FINAL */
PyDict_SetItemString(sysdict, "version_info",
! v = Py_BuildValue("iiiN", PY_MAJOR_VERSION,
PY_MINOR_VERSION,
! PY_MICRO_VERSION, v));
Py_XDECREF(v);
PyDict_SetItemString(sysdict, "copyright",
--- 409,433 ----
v = PyInt_FromLong(PY_VERSION_HEX));
Py_XDECREF(v);
+ /*
+ * These release level checks are mutually exclusive and cover
+ * the field, so don't get too fancy with the pre-processor!
+ */
+ #if PY_RELEASE_LEVEL == PY_RELEASE_LEVEL_ALPHA
+ v = PyString_FromString("alpha");
+ #endif
+ #if PY_RELEASE_LEVEL == PY_RELEASE_LEVEL_BETA
+ v = PyString_FromString("beta");
+ #endif
+ #if PY_RELEASE_LEVEL == PY_RELEASE_LEVEL_GAMMA
+ v = PyString_FromString("candidate");
+ #endif
#if PY_RELEASE_LEVEL == PY_RELEASE_LEVEL_FINAL
! v = PyString_FromString("final");
! #endif
PyDict_SetItemString(sysdict, "version_info",
! v = Py_BuildValue("iiiNi", PY_MAJOR_VERSION,
PY_MINOR_VERSION,
! PY_MICRO_VERSION, v,
! PY_RELEASE_SERIAL));
Py_XDECREF(v);
PyDict_SetItemString(sysdict, "copyright",