From: Finn B. <bc...@us...> - 2001-11-03 19:26:07
|
Update of /cvsroot/jython/jython/org/python/util In directory usw-pr-cvs1:/tmp/cvs-serv26183/util Modified Files: PythonInterpreter.java jython.java Log Message: Fix for "[ #476772 ] shutdowns in jython / atexit" Call sys.exitfunc when the interpreter is about to exit. Index: PythonInterpreter.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/util/PythonInterpreter.java,v retrieving revision 2.8 retrieving revision 2.9 diff -C2 -d -r2.8 -r2.9 *** PythonInterpreter.java 2001/10/28 17:13:44 2.8 --- PythonInterpreter.java 2001/11/03 19:26:02 2.9 *************** *** 219,221 **** --- 219,225 ---- return Py.tojava(locals.__finditem__(name.intern()), javaclass); } + + public void cleanup() { + systemState.callExitFunc(); + } } Index: jython.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/util/jython.java,v retrieving revision 2.20 retrieving revision 2.21 diff -C2 -d -r2.20 -r2.21 *** jython.java 2001/10/28 17:13:44 2.20 --- jython.java 2001/11/03 19:26:02 2.21 *************** *** 166,171 **** } catch (Throwable t) { Py.printException(t); ! if (!opts.interactive) System.exit(-1); } } --- 166,173 ---- } catch (Throwable t) { Py.printException(t); ! if (!opts.interactive) { ! interp.cleanup(); System.exit(-1); + } } } *************** *** 194,197 **** --- 196,200 ---- } } + interp.cleanup(); } } |