From: Finn B. <bc...@us...> - 2001-11-21 11:43:35
|
Update of /cvsroot/jython/jython/org/python/core In directory usw-pr-cvs1:/tmp/cvs-serv18182 Modified Files: Py.java Log Message: Fix for [ #480390 ] main() does not throw exceptions. Add a throw clause to the runMain() method signature and don't print the exception in runMain(). Instead the exception must be printed by one of the callers of runMain() which typically is the JVM. Index: Py.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/core/Py.java,v retrieving revision 2.54 retrieving revision 2.55 diff -C2 -d -r2.54 -r2.55 *** Py.java 2001/11/21 11:21:21 2.54 --- Py.java 2001/11/21 11:43:32 2.55 *************** *** 797,801 **** String[] props, String frozenPackage, ! String[] modules) { //System.err.println("main: "+module); --- 797,801 ---- String[] props, String frozenPackage, ! String[] modules) throws Exception { //System.err.println("main: "+module); *************** *** 814,820 **** PyObject mod = imp.createFromCode("__main__", code); } catch (PyException e) { - Py.printException(e); Py.getSystemState().callExitFunc(); ! System.exit(-1); } Py.getSystemState().callExitFunc(); --- 814,819 ---- PyObject mod = imp.createFromCode("__main__", code); } catch (PyException e) { Py.getSystemState().callExitFunc(); ! throw e; } Py.getSystemState().callExitFunc(); |