Mercurial > cpython-lru_cache-weakref
comparison 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 |
comparison
equal
deleted
inserted
replaced
| 36069:d0214bb1fd51 | 36070:9697eeeaf246 |
|---|---|
| 1000 PyDict_SetItemString(sysdict, "version", | 1000 PyDict_SetItemString(sysdict, "version", |
| 1001 v = PyString_FromString(Py_GetVersion())); | 1001 v = PyString_FromString(Py_GetVersion())); |
| 1002 Py_XDECREF(v); | 1002 Py_XDECREF(v); |
| 1003 PyDict_SetItemString(sysdict, "hexversion", | 1003 PyDict_SetItemString(sysdict, "hexversion", |
| 1004 v = PyInt_FromLong(PY_VERSION_HEX)); | 1004 v = PyInt_FromLong(PY_VERSION_HEX)); |
| 1005 Py_XDECREF(v); | |
| 1006 PyDict_SetItemString(sysdict, "build_number", | |
| 1007 v = PyString_FromString(Py_GetBuildNumber())); | |
| 1005 Py_XDECREF(v); | 1008 Py_XDECREF(v); |
| 1006 /* | 1009 /* |
| 1007 * These release level checks are mutually exclusive and cover | 1010 * These release level checks are mutually exclusive and cover |
| 1008 * the field, so don't get too fancy with the pre-processor! | 1011 * the field, so don't get too fancy with the pre-processor! |
| 1009 */ | 1012 */ |
