diff Python/sysmodule.c @ 36070:9697eeeaf246 legacy-trunk

Expose Subversion revision number (calculated via "svnversion .") to Python. Add C API function Py_GetBuildNumber(), add it to the interactive prompt banner (i.e. Py_GetBuildInfo()), and add it as the sys.build_number attribute. The build number is a string instead of an int because it may contain a trailing 'M' if there are local modifications.
author Barry Warsaw <barry@python.org>
date Sun, 18 Dec 2005 01:27:35 +0000
parents 1c4d192f1568
children 825a041813fb
line wrap: on
line diff
--- a/Python/sysmodule.c	Sat Dec 17 22:24:12 2005 +0000
+++ b/Python/sysmodule.c	Sun Dec 18 01:27:35 2005 +0000
@@ -1003,6 +1003,9 @@
 	PyDict_SetItemString(sysdict, "hexversion",
 			     v = PyInt_FromLong(PY_VERSION_HEX));
 	Py_XDECREF(v);
+	PyDict_SetItemString(sysdict, "build_number",
+			     v = PyString_FromString(Py_GetBuildNumber()));
+	Py_XDECREF(v);
 	/*
 	 * These release level checks are mutually exclusive and cover
 	 * the field, so don't get too fancy with the pre-processor!