From: Finn B. <bc...@us...> - 2001-04-13 18:32:57
|
Update of /cvsroot/jython/jython/org/python/core In directory usw-pr-cvs1:/tmp/cvs-serv29466 Modified Files: PySystemState.java Log Message: Assign a value to the sys.hexversion and sys.version_info fields. Index: PySystemState.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/core/PySystemState.java,v retrieving revision 2.54 retrieving revision 2.55 diff -C2 -r2.54 -r2.55 *** PySystemState.java 2001/03/22 20:01:25 2.54 --- PySystemState.java 2001/04/13 18:32:55 2.55 *************** *** 20,23 **** --- 20,37 ---- public static String version = "2.1a1"; + private static int PY_MAJOR_VERSION = 2; + private static int PY_MINOR_VERSION = 1; + private static int PY_MICRO_VERSION = 0; + private static int PY_RELEASE_LEVEL = 0xA; + private static int PY_RELEASE_SERIAL = 1; + + public static int hexversion = ((PY_MAJOR_VERSION << 24) | + (PY_MINOR_VERSION << 16) | + (PY_MICRO_VERSION << 8) | + (PY_RELEASE_LEVEL << 4) | + (PY_RELEASE_SERIAL << 0)); + + public static PyTuple version_info; + /** * The copyright notice for this release. *************** *** 389,392 **** --- 403,422 ---- Py.stderr = new StderrWrapper(); Py.stdout = new StdoutWrapper(); + + String s = null; + if (PY_RELEASE_LEVEL == 0x0A) + s = "alpha"; + else if (PY_RELEASE_LEVEL == 0x0B) + s = "beta"; + else if (PY_RELEASE_LEVEL == 0x0C) + s = "candidate"; + else if (PY_RELEASE_LEVEL == 0x0C) + s = "final"; + version_info = new PyTuple(new PyObject[] { + Py.newInteger(PY_MAJOR_VERSION), + Py.newInteger(PY_MINOR_VERSION), + Py.newInteger(PY_MICRO_VERSION), + Py.newString(s), + Py.newInteger(PY_RELEASE_SERIAL) }); } |