comparison Python/sysmodule.c @ 12394:60dd95c75999 legacy-trunk

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.
author Fred Drake <fdrake@acm.org>
date Thu, 13 Apr 2000 15:29:10 +0000
parents 9b9abde032b3
children f82b2577fa0c
comparison
equal deleted inserted replaced
12393:a0498b15244c 12394:60dd95c75999
350 "\n\ 350 "\n\
351 Static objects:\n\ 351 Static objects:\n\
352 \n\ 352 \n\
353 maxint -- the largest supported integer (the smallest is -maxint-1)\n\ 353 maxint -- the largest supported integer (the smallest is -maxint-1)\n\
354 builtin_module_names -- tuple of module names built into this intepreter\n\ 354 builtin_module_names -- tuple of module names built into this intepreter\n\
355 version -- the version of this interpreter\n\ 355 version -- the version of this interpreter as a string\n\
356 version_info -- version information as a tuple\n\
357 hexversion -- version information encoded as a single integer\n\
356 copyright -- copyright notice pertaining to this interpreter\n\ 358 copyright -- copyright notice pertaining to this interpreter\n\
357 platform -- platform identifier\n\ 359 platform -- platform identifier\n\
358 executable -- pathname of this Python interpreter\n\ 360 executable -- pathname of this Python interpreter\n\
359 prefix -- prefix used to find the Python library\n\ 361 prefix -- prefix used to find the Python library\n\
360 exec_prefix -- prefix used to find the machine-specific Python library\n\ 362 exec_prefix -- prefix used to find the machine-specific Python library\n\
403 PyDict_SetItemString(sysdict, "version", 405 PyDict_SetItemString(sysdict, "version",
404 v = PyString_FromString(Py_GetVersion())); 406 v = PyString_FromString(Py_GetVersion()));
405 Py_XDECREF(v); 407 Py_XDECREF(v);
406 PyDict_SetItemString(sysdict, "hexversion", 408 PyDict_SetItemString(sysdict, "hexversion",
407 v = PyInt_FromLong(PY_VERSION_HEX)); 409 v = PyInt_FromLong(PY_VERSION_HEX));
410 Py_XDECREF(v);
411 #if PY_RELEASE_LEVEL == PY_RELEASE_LEVEL_FINAL
412 v = PyString_FromStringAndSize(NULL, 0);
413 #else
414 {
415 char buff[3];
416 buff[0] = PY_RELEASE_LEVEL - PY_RELEASE_LEVEL_ALPHA + 'a';
417 buff[1] = PY_RELEASE_SERIAL + '0';
418 buff[2] = '\0';
419 v = PyString_FromString(buff);
420 }
421 #endif /* PY_RELEASE_LEVEL == PY_RELEASE_LEVEL_FINAL */
422 PyDict_SetItemString(sysdict, "version_info",
423 v = Py_BuildValue("iiiN", PY_MAJOR_VERSION,
424 PY_MINOR_VERSION,
425 PY_MICRO_VERSION, v));
408 Py_XDECREF(v); 426 Py_XDECREF(v);
409 PyDict_SetItemString(sysdict, "copyright", 427 PyDict_SetItemString(sysdict, "copyright",
410 v = PyString_FromString(Py_GetCopyright())); 428 v = PyString_FromString(Py_GetCopyright()));
411 Py_XDECREF(v); 429 Py_XDECREF(v);
412 PyDict_SetItemString(sysdict, "platform", 430 PyDict_SetItemString(sysdict, "platform",