diff Python/sysmodule.c @ 9746:9342c60eaac0 legacy-trunk

Add sys.hexversion, which is an integer encoding the version in hexadecimal. In other words, hex(sys.hexversion) == 0x010502b2 for Python 1.5.2b2. This is derived from the new variable PY_VERSION_HEX defined in patchlevel.h. (Cute, eh?)
author Guido van Rossum <guido@python.org>
date Sun, 03 Jan 1999 12:55:39 +0000
parents 81574e4646b4
children 030ee50bd8d1
line wrap: on
line diff
--- a/Python/sysmodule.c	Sun Jan 03 12:41:50 1999 +0000
+++ b/Python/sysmodule.c	Sun Jan 03 12:55:39 1999 +0000
@@ -396,6 +396,8 @@
 	Py_XDECREF(syserr);
 	PyDict_SetItemString(sysdict, "version",
 			     v = PyString_FromString(Py_GetVersion()));
+	PyDict_SetItemString(sysdict, "hexversion",
+			     v = PyInt_FromLong(PY_VERSION_HEX));
 	Py_XDECREF(v);
 	PyDict_SetItemString(sysdict, "copyright",
 			     v = PyString_FromString(Py_GetCopyright()));