From 2a38a86c1c48adbf9cf76d485c515002f042fd56 Mon Sep 17 00:00:00 2001 From: Barry Warsaw Date: Sun, 18 Dec 2005 01:27:35 +0000 Subject: 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. --- Python/sysmodule.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'Python/sysmodule.c') diff --git a/Python/sysmodule.c b/Python/sysmodule.c index d9f1337057..f97a56deb5 100644 --- a/Python/sysmodule.c +++ b/Python/sysmodule.c @@ -1003,6 +1003,9 @@ _PySys_Init(void) 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! -- cgit v1.2.1