From: Samuele P. <ped...@us...> - 2000-11-19 22:32:48
|
Update of /cvsroot/jython/jython/org/python/core In directory slayer.i.sourceforge.net:/tmp/cvs-serv3159/org/python/core Modified Files: BytecodeLoader.java PyDictionary.java PyReflectedConstructor.java PySystemState.java imp.java Log Message: * [Bug #122610] SecEx in MS applerviewer, now if Py.frozen true: sys.path=[] cache not init. * BytecodeLoader now uses findLoadedClass to avoid redef exc. More robust jythonc/compile.getJavaClass. * mini-fix to enable compilation inside Sun Forte (tm). * makeup Index: BytecodeLoader.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/core/BytecodeLoader.java,v retrieving revision 2.7 retrieving revision 2.8 diff -C2 -r2.7 -r2.8 *** BytecodeLoader.java 2000/11/17 12:32:43 2.7 --- BytecodeLoader.java 2000/11/19 22:32:45 2.8 *************** *** 59,62 **** --- 59,66 ---- } + Class c = findLoadedClass(name); + if (c != null) + return c; + /* previously: if Options.extendedClassLoader && Index: PyDictionary.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/core/PyDictionary.java,v retrieving revision 2.9 retrieving revision 2.10 diff -C2 -r2.9 -r2.10 *** PyDictionary.java 2000/09/29 17:46:20 2.9 --- PyDictionary.java 2000/11/19 22:32:45 2.10 *************** *** 75,80 **** ! public class PyDictionary extends PyObject implements InitModule { protected Hashtable table; protected static PyObject __methods__; --- 75,81 ---- ! public class PyDictionary extends PyObject implements ClassDictInit { + protected Hashtable table; protected static PyObject __methods__; *************** *** 106,110 **** } ! public void initModule(PyObject dict) { dict.__setitem__("__len__", new DictFuncs("__len__", 1, 0)); dict.__setitem__("__nonzero__", new DictFuncs("__nonzero__", 2, 0)); --- 107,111 ---- } ! public static void classDictInit(PyObject dict) { dict.__setitem__("__len__", new DictFuncs("__len__", 1, 0)); dict.__setitem__("__nonzero__", new DictFuncs("__nonzero__", 2, 0)); *************** *** 124,127 **** --- 125,129 ---- dict.__setitem__("toString", null); dict.__setitem__("hashCode", null); + dict.__setitem__("classDictInit", null); } Index: PyReflectedConstructor.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/core/PyReflectedConstructor.java,v retrieving revision 2.5 retrieving revision 2.6 diff -C2 -r2.5 -r2.6 *** PyReflectedConstructor.java 1999/09/16 22:05:38 2.5 --- PyReflectedConstructor.java 2000/11/19 22:32:45 2.6 *************** *** 117,121 **** // Do the actual constructor call ! Object jself; ThreadState ts = Py.getThreadState(); try { --- 117,121 ---- // Do the actual constructor call ! Object jself = null; ThreadState ts = Py.getThreadState(); try { Index: PySystemState.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/core/PySystemState.java,v retrieving revision 2.31 retrieving revision 2.32 diff -C2 -r2.31 -r2.32 *** PySystemState.java 2000/11/17 20:52:48 2.31 --- PySystemState.java 2000/11/19 22:32:45 2.32 *************** *** 309,316 **** // Initialize the path (and add system defaults) defaultPath = initPath(registry); - if (prefix != null) { - String libpath = new File(prefix, "Lib").toString(); - defaultPath.append(new PyString(libpath)); - } // Set up the known Java packages --- 309,312 ---- *************** *** 435,444 **** private static PyList initPath(Properties props) { PyList path = new PyList(); ! String pypath = props.getProperty("python.path", ""); ! StringTokenizer tok = new StringTokenizer(pypath, java.io.File.pathSeparator); ! while (tok.hasMoreTokens()) { ! String p = tok.nextToken(); ! path.append(new PyString(p.trim())); } return path; --- 431,446 ---- private static PyList initPath(Properties props) { PyList path = new PyList(); ! if (!Py.frozen) { ! String pypath = props.getProperty("python.path", ""); ! StringTokenizer tok = new StringTokenizer(pypath, java.io.File.pathSeparator); ! while (tok.hasMoreTokens()) { ! String p = tok.nextToken(); ! path.append(new PyString(p.trim())); ! } ! if (prefix != null) { ! String libpath = new File(prefix, "Lib").toString(); ! path.append(new PyString(libpath)); ! } } return path; Index: imp.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/core/imp.java,v retrieving revision 2.29 retrieving revision 2.30 diff -C2 -r2.29 -r2.30 *** imp.java 2000/11/17 21:14:24 2.29 --- imp.java 2000/11/19 22:32:45 2.30 *************** *** 162,170 **** } - private static PyObject createFromClass(String name, InputStream fp) { - BytecodeLoader bcl = getSyspathJavaLoader(); - return createFromClass(name, bcl.makeClass(name, readBytes(fp))); - } - private static PyObject createFromClass(String name, Class c) { //Two choices. c implements PyRunnable or c is Java package --- 162,165 ---- |