From: Finn B. <bc...@us...> - 2000-11-17 21:12:59
|
Update of /cvsroot/jython/jython/org/python/core In directory slayer.i.sourceforge.net:/tmp/cvs-serv15045 Modified Files: imp.java Log Message: Avoid static initializers in this file. For some unknown reason they break applets in MS-IE. Index: imp.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/core/imp.java,v retrieving revision 2.27 retrieving revision 2.28 diff -C2 -r2.27 -r2.28 *** imp.java 2000/11/17 12:32:43 2.27 --- imp.java 2000/11/17 21:12:40 2.28 *************** *** 526,530 **** frame.f_globals, frame.f_locals, ! all }); --- 526,530 ---- frame.f_globals, frame.f_locals, ! getStarArg() }); *************** *** 570,578 **** } ! private static PyTuple all = new PyTuple( ! new PyString[] { ! Py.newString('*') ! }); /** * Called from jpython generated code when a statement like --- 570,581 ---- } ! private static PyTuple all = null; + private synchronized static PyTuple getStarArg() { + if (all == null) + all = new PyTuple(new PyString[] { Py.newString('*') }); + return all; + } + /** * Called from jpython generated code when a statement like *************** *** 585,589 **** frame.f_globals, frame.f_locals, ! all } ); PyObject names; if (module instanceof PyJavaPackage) names = ((PyJavaPackage)module).fillDir(); --- 588,592 ---- frame.f_globals, frame.f_locals, ! getStarArg() } ); PyObject names; if (module instanceof PyJavaPackage) names = ((PyJavaPackage)module).fillDir(); *************** *** 655,661 **** } ! private static PyObject __import__ = Py.newString("__import__"); private static PyObject getImportFunc(PyFrame frame) { // Set up f_builtins if not already set PyObject builtins = frame.f_builtins; --- 658,666 ---- } ! private static PyObject __import__ = null; private static PyObject getImportFunc(PyFrame frame) { + if (__import__ == null) + __import__ = Py.newString("__import__"); // Set up f_builtins if not already set PyObject builtins = frame.f_builtins; |