From: Finn B. <bc...@us...> - 2002-01-13 18:13:30
|
Update of /cvsroot/jython/jython/org/python/core In directory usw-pr-cvs1:/tmp/cvs-serv17807 Modified Files: Options.java Log Message: Two new options: Qnew and divisionWarning. In support for pep-238. Index: Options.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/core/Options.java,v retrieving revision 2.11 retrieving revision 2.12 diff -C2 -d -r2.11 -r2.12 *** Options.java 2002/01/11 10:18:33 2.11 --- Options.java 2002/01/13 18:13:28 2.12 *************** *** 82,85 **** --- 82,100 ---- public static boolean caseok = false; + /** + * If true, enable truedivision for the '/' operator. + */ + public static boolean Qnew = false; + + /** + * Enable division warning. The value maps to the registry values of + * <ul> + * <li>old: 0</li> + * <li>warn: 1</li> + * <li>warnall: 2</li> + * </ul> + */ + public static int divisionWarning = 0; + // // ####### END OF OPTIONS *************** *** 156,159 **** --- 171,189 ---- getBooleanOption("options.caseok", Options.caseok); + Options.Qnew = + getBooleanOption("options.Qnew", Options.Qnew); + + prop = PySystemState.registry.getProperty("python.divisionWarning"); + if (prop != null) { + if (prop.equalsIgnoreCase("old")) + Options.divisionWarning = 0; + else if (prop.equalsIgnoreCase("warn")) + Options.divisionWarning = 1; + else if (prop.equalsIgnoreCase("warnall")) + Options.divisionWarning = 2; + else + throw Py.ValueError("Illegal divisionWarning option " + + "setting: '"+ prop+"'"); + } // additional initializations which must happen after the registry // is guaranteed to be initialized. |