[Python-checkins] CVS: python/dist/src/Python sysmodule.c,2.59,2.60

Fred Drake python-dev@python.org
Thu, 13 Apr 2000 11:29:13 -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:

Define version_info to be a tuple (major, minor, micro, level); level
is a string "a2", "b1", "c1", or '' for a final release.

Added version_info and hexversion to the module docstring.


Index: sysmodule.c
===================================================================
RCS file: /projects/cvsroot/python/dist/src/Python/sysmodule.c,v
retrieving revision 2.59
retrieving revision 2.60
diff -C2 -r2.59 -r2.60
*** sysmodule.c	2000/03/31 00:38:29	2.59
--- sysmodule.c	2000/04/13 15:29:10	2.60
***************
*** 353,357 ****
  maxint -- the largest supported integer (the smallest is -maxint-1)\n\
  builtin_module_names -- tuple of module names built into this intepreter\n\
! version -- the version of this interpreter\n\
  copyright -- copyright notice pertaining to this interpreter\n\
  platform -- platform identifier\n\
--- 353,359 ----
  maxint -- the largest supported integer (the smallest is -maxint-1)\n\
  builtin_module_names -- tuple of module names built into this intepreter\n\
! version -- the version of this interpreter as a string\n\
! version_info -- version information as a tuple\n\
! hexversion -- version information encoded as a single integer\n\
  copyright -- copyright notice pertaining to this interpreter\n\
  platform -- platform identifier\n\
***************
*** 406,409 ****
--- 408,427 ----
  	PyDict_SetItemString(sysdict, "hexversion",
  			     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",