Update of /cvsroot/jython/jython/org/python/core In directory usw-pr-cvs1:/tmp/cvs-serv9040/core Modified Files: CompilerFlags.java InternalTables.java Options.java PackageManager.java Py.java PyCell.java PyClass.java PyCode.java PyFrame.java PyFunction.java PyJavaInstance.java PyList.java PyModule.java PySystemState.java PyTableCode.java SyspathArchive.java __builtin__.java imp.java parser.java Log Message: Whitespace normalization. Index: CompilerFlags.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/core/CompilerFlags.java,v retrieving revision 2.2 retrieving revision 2.3 diff -C2 -d -r2.2 -r2.3 *** CompilerFlags.java 2001/07/25 18:48:43 2.2 --- CompilerFlags.java 2001/11/27 13:51:37 2.3 *************** *** 3,9 **** public class CompilerFlags extends Object { ! public CompilerFlags() {} ! public CompilerFlags(int co_flags) { if ((co_flags&org.python.core.PyTableCode.CO_NESTED) != 0) nested_scopes = true; --- 3,9 ---- public class CompilerFlags extends Object { ! public CompilerFlags() {} ! public CompilerFlags(int co_flags) { if ((co_flags&org.python.core.PyTableCode.CO_NESTED) != 0) nested_scopes = true; Index: InternalTables.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/core/InternalTables.java,v retrieving revision 2.9 retrieving revision 2.10 diff -C2 -d -r2.9 -r2.10 *** InternalTables.java 2001/07/27 15:46:33 2.9 --- InternalTables.java 2001/11/27 13:51:37 2.10 *************** *** 46,50 **** java.util.Properties registry = PySystemState.registry; if (registry == null) { ! throw new java.lang.IllegalStateException("Jython interpreter state not initialized. " + "You need to call PySystemState.initialize or PythonInterpreter.initialize."); } --- 46,50 ---- java.util.Properties registry = PySystemState.registry; if (registry == null) { ! throw new java.lang.IllegalStateException("Jython interpreter state not initialized. " + "You need to call PySystemState.initialize or PythonInterpreter.initialize."); } Index: Options.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/core/Options.java,v retrieving revision 2.9 retrieving revision 2.10 diff -C2 -d -r2.9 -r2.10 *** Options.java 2001/10/28 17:13:42 2.9 --- Options.java 2001/11/27 13:51:37 2.10 *************** *** 76,81 **** /** * If true, Jython will use the first module found on sys.path ! * where java File.isFile() returns true. Setting this to true ! * have no effect on unix-type filesystems. On Windows/HPS+ * systems setting it to true will enable Jython-2.0 behaviour. */ --- 76,81 ---- /** * If true, Jython will use the first module found on sys.path ! * where java File.isFile() returns true. Setting this to true ! * have no effect on unix-type filesystems. On Windows/HPS+ * systems setting it to true will enable Jython-2.0 behaviour. */ Index: PackageManager.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/core/PackageManager.java,v retrieving revision 2.10 retrieving revision 2.11 diff -C2 -d -r2.10 -r2.11 *** PackageManager.java 2001/10/28 17:13:42 2.10 --- PackageManager.java 2001/11/27 13:51:37 2.11 *************** *** 46,50 **** * Append a directory to the list of directories searched for * java packages and java classes. ! * * @param dir A directory. */ --- 46,50 ---- * Append a directory to the list of directories searched for * java packages and java classes. ! * * @param dir A directory. */ *************** *** 54,58 **** * Append a directory to the list of directories searched for * java packages and java classes. ! * * @param dir A directory name. */ --- 54,58 ---- * Append a directory to the list of directories searched for * java packages and java classes. ! * * @param dir A directory name. */ *************** *** 62,66 **** * Append a jar file to the list of locations searched for * java packages and java classes. ! * * @param jarfile A directory name. */ --- 62,66 ---- * Append a jar file to the list of locations searched for * java packages and java classes. ! * * @param jarfile A directory name. */ Index: Py.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/core/Py.java,v retrieving revision 2.56 retrieving revision 2.57 diff -C2 -d -r2.56 -r2.57 *** Py.java 2001/11/26 11:00:24 2.56 --- Py.java 2001/11/27 13:51:37 2.57 *************** *** 241,245 **** warning(RuntimeWarning, message); } ! private static PyObject warnings_mod; private static PyObject importWarnings() { --- 241,245 ---- warning(RuntimeWarning, message); } ! private static PyObject warnings_mod; private static PyObject importWarnings() { *************** *** 257,261 **** return mod; } ! private static String warn_hcategory(PyObject category) { PyObject name = category.__findattr__("__name__"); --- 257,261 ---- return mod; } ! private static String warn_hcategory(PyObject category) { PyObject name = category.__findattr__("__name__"); *************** *** 263,267 **** return "[warning]"; } ! public static void warning(PyObject category, String message) { PyObject func = null; --- 263,267 ---- return "[warning]"; } ! public static void warning(PyObject category, String message) { PyObject func = null; *************** *** 286,290 **** return; } else { ! func.__call__(new PyObject[] {Py.newString(message), category, Py.newString(filename), Py.newInteger(lineno), (module == null)?Py.None:Py.newString(module), registry}, Py.NoKeywords); --- 286,290 ---- return; } else { ! func.__call__(new PyObject[] {Py.newString(message), category, Py.newString(filename), Py.newInteger(lineno), (module == null)?Py.None:Py.newString(module), registry}, Py.NoKeywords); *************** *** 292,296 **** } ! public static PyObject JavaError; public static PyException JavaError(Throwable t) { --- 292,296 ---- } ! public static PyObject JavaError; public static PyException JavaError(Throwable t) { *************** *** 459,465 **** funcs, func_id, cellvars, freevars, npurecell,moreflags); } ! // -- ! public static PyCode newCode(int argcount, String varnames[], String filename, String name, --- 459,465 ---- funcs, func_id, cellvars, freevars, npurecell,moreflags); } ! // -- ! public static PyCode newCode(int argcount, String varnames[], String filename, String name, *************** *** 489,493 **** public static PyObject newJavaFunc(Class cls, String name) { try { ! java.lang.reflect.Method m = cls.getMethod(name, new Class[] { PyObject[].class, String[].class }); return new JavaFunc(m); --- 489,493 ---- public static PyObject newJavaFunc(Class cls, String name) { try { ! java.lang.reflect.Method m = cls.getMethod(name, new Class[] { PyObject[].class, String[].class }); return new JavaFunc(m); *************** *** 910,914 **** displayException(exc.type, exc.value, exc.traceback); } - ts.exception = null; --- 910,913 ---- *************** *** 1405,1409 **** return makeClass(name, bases, code, doc, null, null); } ! public static PyObject makeClass(String name, PyObject[] bases, PyCode code, PyObject doc,PyObject[] closure_cells) --- 1404,1408 ---- return makeClass(name, bases, code, doc, null, null); } ! public static PyObject makeClass(String name, PyObject[] bases, PyCode code, PyObject doc,PyObject[] closure_cells) *************** *** 1412,1425 **** } ! public static PyObject makeClass(String name, PyObject[] bases, PyCode code, PyObject doc, Class proxyClass) { ! return makeClass(name, bases, code, doc, proxyClass, null); } private static Class[] pyClassCtrSignature = {String.class,PyTuple.class,PyObject.class,Class.class}; ! public static PyObject makeClass(String name, PyObject[] bases, PyCode code, PyObject doc, --- 1411,1424 ---- } ! public static PyObject makeClass(String name, PyObject[] bases, PyCode code, PyObject doc, Class proxyClass) { ! return makeClass(name, bases, code, doc, proxyClass, null); } private static Class[] pyClassCtrSignature = {String.class,PyTuple.class,PyObject.class,Class.class}; ! public static PyObject makeClass(String name, PyObject[] bases, PyCode code, PyObject doc, *************** *** 1457,1461 **** } } ! } --- 1456,1460 ---- } } ! } *************** *** 1477,1485 **** cflags = new CompilerFlags(frame.f_code.co_flags); } ! return cflags; } ! // w/o compiler-flags ! public static PyCode compile(SimpleNode node, String filename) { return compile(node, getName(), filename); --- 1476,1484 ---- cflags = new CompilerFlags(frame.f_code.co_flags); } ! return cflags; } ! // w/o compiler-flags ! public static PyCode compile(SimpleNode node, String filename) { return compile(node, getName(), filename); *************** *** 1499,1503 **** return compile_flags(node,name,filename,linenumbers,printResults,null); } ! public static PyCode compile(InputStream istream, String filename, String type) --- 1498,1502 ---- return compile_flags(node,name,filename,linenumbers,printResults,null); } ! public static PyCode compile(InputStream istream, String filename, String type) *************** *** 1505,1511 **** return compile_flags(istream,filename,type,null); } ! // with compiler-flags ! public static PyCode compile_flags(SimpleNode node, String name, String filename, --- 1504,1510 ---- return compile_flags(istream,filename,type,null); } ! // with compiler-flags ! public static PyCode compile_flags(SimpleNode node, String name, String filename, *************** *** 1536,1545 **** return Py.compile_flags(node, getName(), filename, true, printResults,cflags); } ! public static PyCode compile_flags(String data, String filename, String type,CompilerFlags cflags) { return Py.compile_flags(new java.io.StringBufferInputStream(data+"\n\n"), filename, type,cflags); } ! public static PyObject[] unpackSequence(PyObject o, int length) { if (o instanceof PyTuple) { --- 1535,1544 ---- return Py.compile_flags(node, getName(), filename, true, printResults,cflags); } ! public static PyCode compile_flags(String data, String filename, String type,CompilerFlags cflags) { return Py.compile_flags(new java.io.StringBufferInputStream(data+"\n\n"), filename, type,cflags); } ! public static PyObject[] unpackSequence(PyObject o, int length) { if (o instanceof PyTuple) { *************** *** 1728,1732 **** /** ! * A function object wrapper for a java method which comply with the * PyArgsKeywordsCall standard. */ --- 1727,1731 ---- /** ! * A function object wrapper for a java method which comply with the * PyArgsKeywordsCall standard. */ Index: PyCell.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/core/PyCell.java,v retrieving revision 2.1 retrieving revision 2.2 diff -C2 -d -r2.1 -r2.2 *** PyCell.java 2001/03/08 23:43:51 2.1 --- PyCell.java 2001/11/27 13:51:37 2.2 *************** *** 1,3 **** ! package org.python.core; --- 1,3 ---- ! package org.python.core; *************** *** 5,8 **** public PyObject ob_ref; ! } --- 5,8 ---- public PyObject ob_ref; ! } Index: PyClass.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/core/PyClass.java,v retrieving revision 2.26 retrieving revision 2.27 diff -C2 -d -r2.26 -r2.27 *** PyClass.java 2001/10/28 17:13:43 2.26 --- PyClass.java 2001/11/27 13:51:37 2.27 *************** *** 236,240 **** return; } ! __dict__.__setitem__(name, value); } --- 236,240 ---- return; } ! __dict__.__setitem__(name, value); } Index: PyCode.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/core/PyCode.java,v retrieving revision 2.6 retrieving revision 2.7 diff -C2 -d -r2.6 -r2.7 *** PyCode.java 2001/10/28 17:13:43 2.6 --- PyCode.java 2001/11/27 13:51:37 2.7 *************** *** 8,14 **** { public String co_name; ! abstract public PyObject call(PyFrame frame, PyObject closure); ! public PyObject call(PyFrame frame) { return call(frame,null); } // commodity --- 8,14 ---- { public String co_name; ! abstract public PyObject call(PyFrame frame, PyObject closure); ! public PyObject call(PyFrame frame) { return call(frame,null); } // commodity Index: PyFrame.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/core/PyFrame.java,v retrieving revision 2.11 retrieving revision 2.12 diff -C2 -d -r2.11 -r2.12 *** PyFrame.java 2001/10/28 17:13:43 2.11 --- PyFrame.java 2001/11/27 13:51:37 2.12 *************** *** 19,23 **** public int f_ncells; public int f_nfreevars; ! // an interface to functions suitable for tracing, e.g. via sys.settrace() public TraceFunction tracefunc; --- 19,23 ---- public int f_ncells; public int f_nfreevars; ! // an interface to functions suitable for tracing, e.g. via sys.settrace() public TraceFunction tracefunc; *************** *** 131,135 **** PyObject v = f_env[j].ob_ref; if (v != null) f_locals.__setitem__(f_code.co_freevars[i],v); ! } } return f_locals; --- 131,135 ---- PyObject v = f_env[j].ob_ref; if (v != null) f_locals.__setitem__(f_code.co_freevars[i],v); ! } } return f_locals; *************** *** 212,218 **** if (f_fastlocals != null) { if (f_fastlocals[index] == null) { ! throw Py.UnboundLocalError("local: '"+f_code.co_varnames[index]+"'"); } ! f_fastlocals[index] = null; } else dellocal(f_code.co_varnames[index]); --- 212,218 ---- if (f_fastlocals != null) { if (f_fastlocals[index] == null) { ! throw Py.UnboundLocalError("local: '"+f_code.co_varnames[index]+"'"); } ! f_fastlocals[index] = null; } else dellocal(f_code.co_varnames[index]); *************** *** 226,230 **** } catch(PyException e) { if (!Py.matchException(e,Py.KeyError)) throw e; ! throw Py.UnboundLocalError("local: '"+index+"'"); } } --- 226,230 ---- } catch(PyException e) { if (!Py.matchException(e,Py.KeyError)) throw e; ! throw Py.UnboundLocalError("local: '"+index+"'"); } } *************** *** 233,243 **** f_globals.__delitem__(index); } ! // nested scopes helpers ! public PyObject getclosure(int index) { return f_env[index]; } ! public PyObject getderef(int index) { PyObject obj=f_env[index].ob_ref; --- 233,243 ---- f_globals.__delitem__(index); } ! // nested scopes helpers ! public PyObject getclosure(int index) { return f_env[index]; } ! public PyObject getderef(int index) { PyObject obj=f_env[index].ob_ref; *************** *** 246,259 **** if (index >= f_ncells) name = f_code.co_freevars[index-f_ncells]; else name = f_code.co_cellvars[index]; ! throw Py.UnboundLocalError("local: '"+name+"'"); } ! public void setderef(int index,PyObject value) { f_env[index].ob_ref = value; } ! public void to_cell(int parm_index,int env_index) { ! f_env[env_index].ob_ref=f_fastlocals[parm_index]; } - } --- 246,258 ---- if (index >= f_ncells) name = f_code.co_freevars[index-f_ncells]; else name = f_code.co_cellvars[index]; ! throw Py.UnboundLocalError("local: '"+name+"'"); } ! public void setderef(int index,PyObject value) { f_env[index].ob_ref = value; } ! public void to_cell(int parm_index,int env_index) { ! f_env[env_index].ob_ref=f_fastlocals[parm_index]; } } Index: PyFunction.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/core/PyFunction.java,v retrieving revision 2.12 retrieving revision 2.13 diff -C2 -d -r2.12 -r2.13 *** PyFunction.java 2001/10/28 17:13:43 2.12 --- PyFunction.java 2001/11/27 13:51:37 2.13 *************** *** 38,46 **** this(globals,defaults,code,doc,null); } ! public PyFunction(PyObject globals, PyObject[] defaults, PyCode code) { this(globals, defaults, code, null,null); } ! public PyFunction(PyObject globals, PyObject[] defaults, PyCode code, PyObject[] closure_cells) { this(globals, defaults, code, null,closure_cells); --- 38,46 ---- this(globals,defaults,code,doc,null); } ! public PyFunction(PyObject globals, PyObject[] defaults, PyCode code) { this(globals, defaults, code, null,null); } ! public PyFunction(PyObject globals, PyObject[] defaults, PyCode code, PyObject[] closure_cells) { this(globals, defaults, code, null,closure_cells); Index: PyJavaInstance.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/core/PyJavaInstance.java,v retrieving revision 2.7 retrieving revision 2.8 diff -C2 -d -r2.7 -r2.8 *** PyJavaInstance.java 2001/10/28 17:13:43 2.7 --- PyJavaInstance.java 2001/11/27 13:51:37 2.8 *************** *** 28,32 **** * Implementation of the Externalizable interface. * @param in the input stream. ! * @exception java.io.IOException * @exception ClassNotFoundException */ --- 28,32 ---- * Implementation of the Externalizable interface. * @param in the input stream. ! * @exception java.io.IOException * @exception ClassNotFoundException */ *************** *** 42,46 **** * Implementation of the Externalizable interface. * @param out the output stream. ! * @exception java.io.IOException */ public void writeExternal(java.io.ObjectOutput out) --- 42,46 ---- * Implementation of the Externalizable interface. * @param out the output stream. ! * @exception java.io.IOException */ public void writeExternal(java.io.ObjectOutput out) Index: PyList.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/core/PyList.java,v retrieving revision 2.24 retrieving revision 2.25 diff -C2 -d -r2.24 -r2.25 *** PyList.java 2001/10/28 17:13:43 2.24 --- PyList.java 2001/11/27 13:51:37 2.25 *************** *** 370,374 **** /** ! * Insert the argument element into the list at the specified * index. * <br> --- 370,374 ---- /** ! * Insert the argument element into the list at the specified * index. * <br> *************** *** 402,406 **** /** * Reverses the items of s in place. ! * The reverse() methods modify the list in place for economy * of space when reversing a large list. It doesn't return the * reversed list to remind you of this side effect. --- 402,406 ---- /** * Reverses the items of s in place. ! * The reverse() methods modify the list in place for economy * of space when reversing a large list. It doesn't return the * reversed list to remind you of this side effect. *************** *** 666,676 **** * Sort the items of the list in place. The compare argument is a * function of two arguments (list items) which should return ! * -1, 0 or 1 depending on whether the first argument is ! * considered smaller than, equal to, or larger than the second * argument. Note that this slows the sorting process down * considerably; e.g. to sort a list in reverse order it is much ! * faster to use calls to the methods sort() and reverse() than * to use the built-in function sort() with a comparison function ! * that reverses the ordering of the elements. * * @param compare the comparison function. --- 666,676 ---- * Sort the items of the list in place. The compare argument is a * function of two arguments (list items) which should return ! * -1, 0 or 1 depending on whether the first argument is ! * considered smaller than, equal to, or larger than the second * argument. Note that this slows the sorting process down * considerably; e.g. to sort a list in reverse order it is much ! * faster to use calls to the methods sort() and reverse() than * to use the built-in function sort() with a comparison function ! * that reverses the ordering of the elements. * * @param compare the comparison function. Index: PyModule.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/core/PyModule.java,v retrieving revision 2.13 retrieving revision 2.14 diff -C2 -d -r2.13 -r2.14 *** PyModule.java 2001/10/28 17:13:43 2.13 --- PyModule.java 2001/11/27 13:51:37 2.14 *************** *** 25,29 **** PyObject ret = null; ! if (path == Py.None) { /* disabled: --- 25,29 ---- PyObject ret = null; ! if (path == Py.None) { /* disabled: *************** *** 45,49 **** if (ret != null) { ! // Allow a package component to change its own meaning PyObject tmp = Py.getSystemState().modules.__finditem__(fullName); if (tmp != null) ret = tmp; --- 45,49 ---- if (ret != null) { ! // Allow a package component to change its own meaning PyObject tmp = Py.getSystemState().modules.__finditem__(fullName); if (tmp != null) ret = tmp; Index: PySystemState.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/core/PySystemState.java,v retrieving revision 2.66 retrieving revision 2.67 diff -C2 -d -r2.66 -r2.67 *** PySystemState.java 2001/11/26 11:04:15 2.66 --- PySystemState.java 2001/11/27 13:51:37 2.67 *************** *** 26,30 **** private static int PY_RELEASE_SERIAL = 1; ! public static int hexversion = ((PY_MAJOR_VERSION << 24) | (PY_MINOR_VERSION << 16) | (PY_MICRO_VERSION << 8) | --- 26,30 ---- private static int PY_RELEASE_SERIAL = 1; ! public static int hexversion = ((PY_MAJOR_VERSION << 24) | (PY_MINOR_VERSION << 16) | (PY_MICRO_VERSION << 8) | *************** *** 548,559 **** /** * Add a classpath directory to the list of places that are searched ! * for java packages. * <p> ! * <b>Note</b>. Classes found in directory and subdirectory are not ! * made available to jython by this call. It only make the java * package found ion the directory available. This call is mostly * usefull if jython is embedded in an application that deals with * its own classloaders. A servlet container is a very good example. ! * Calling add_classdir("<context>/WEB-INF/classes") makes the java * packages in WEB-INF classes available to jython import. However the * actual classloading is completely handled by the servlet container's --- 548,559 ---- /** * Add a classpath directory to the list of places that are searched ! * for java packages. * <p> ! * <b>Note</b>. Classes found in directory and subdirectory are not ! * made available to jython by this call. It only make the java * package found ion the directory available. This call is mostly * usefull if jython is embedded in an application that deals with * its own classloaders. A servlet container is a very good example. ! * Calling add_classdir("<context>/WEB-INF/classes") makes the java * packages in WEB-INF classes available to jython import. However the * actual classloading is completely handled by the servlet container's *************** *** 567,571 **** * Add a .jar & .zip directory to the list of places that are searched * for java .jar and .zip files. The .jar and .zip files found will be ! * cached * <p> * <b>Note</b>. Classes in .jar and .zip files found in the directory --- 567,571 ---- * Add a .jar & .zip directory to the list of places that are searched * for java .jar and .zip files. The .jar and .zip files found will be ! * cached * <p> * <b>Note</b>. Classes in .jar and .zip files found in the directory Index: PyTableCode.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/core/PyTableCode.java,v retrieving revision 2.16 retrieving revision 2.17 diff -C2 -d -r2.16 -r2.17 *** PyTableCode.java 2001/10/28 17:13:43 2.16 --- PyTableCode.java 2001/11/27 13:51:37 2.17 *************** *** 25,33 **** final public static int CO_OPTIMIZED = 0x0001; //final public static int CO_NEWLOCALS = 0x0002 ! final public static int CO_VARARGS = 0x0004; final public static int CO_VARKEYWORDS = 0x0008; final public static int CO_NESTED = 0x0010; ! public PyTableCode(int argcount, String varnames[], String filename, String name, --- 25,33 ---- final public static int CO_OPTIMIZED = 0x0001; //final public static int CO_NEWLOCALS = 0x0002 ! final public static int CO_VARARGS = 0x0004; final public static int CO_VARKEYWORDS = 0x0008; final public static int CO_NESTED = 0x0010; ! public PyTableCode(int argcount, String varnames[], String filename, String name, *************** *** 38,42 **** this(argcount,varnames,filename,name,firstlineno,args,keywords,funcs,func_id,null,null,0,0); } ! public PyTableCode(int argcount, String varnames[], String filename, String name, --- 38,42 ---- this(argcount,varnames,filename,name,firstlineno,args,keywords,funcs,func_id,null,null,0,0); } ! public PyTableCode(int argcount, String varnames[], String filename, String name, *************** *** 110,114 **** return new PyTuple(pystr); } ! public PyObject __findattr__(String name) { // have to craft co_varnames specially --- 110,114 ---- return new PyTuple(pystr); } ! public PyObject __findattr__(String name) { // have to craft co_varnames specially *************** *** 153,158 **** env[env_j] = (PyCell)freevars.get(i); } ! ! ts.frame = frame; --- 153,157 ---- env[env_j] = (PyCell)freevars.get(i); } ! ts.frame = frame; Index: SyspathArchive.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/core/SyspathArchive.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** SyspathArchive.java 2001/11/27 11:22:07 1.2 --- SyspathArchive.java 2001/11/27 13:51:37 1.3 *************** *** 89,92 **** } } ! */ } --- 89,92 ---- } } ! */ } Index: __builtin__.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/core/__builtin__.java,v retrieving revision 2.37 retrieving revision 2.38 diff -C2 -d -r2.37 -r2.38 *** __builtin__.java 2001/10/28 17:13:43 2.37 --- __builtin__.java 2001/11/27 13:51:37 2.38 *************** *** 131,135 **** dict.__setitem__("id", new BuiltinFunctions("id", 11, 1)); dict.__setitem__("__import__", new ImportFunction()); ! dict.__delitem__("execfile_flags"); // -execfile_flags } --- 131,135 ---- dict.__setitem__("id", new BuiltinFunctions("id", 11, 1)); dict.__setitem__("__import__", new ImportFunction()); ! dict.__delitem__("execfile_flags"); // -execfile_flags } *************** *** 211,215 **** } ! public static PyCode compile(String data, String filename, String type) { return Py.compile_flags(data,filename,type,Py.getCompilerFlags()); } --- 211,215 ---- } ! public static PyCode compile(String data, String filename, String type) { return Py.compile_flags(data,filename,type,Py.getCompilerFlags()); } *************** *** 282,287 **** execfile_flags(name,globals,locals,Py.getCompilerFlags()); } ! ! public static void execfile_flags(String name, PyObject globals, PyObject locals,CompilerFlags cflags) --- 282,287 ---- execfile_flags(name,globals,locals,Py.getCompilerFlags()); } ! ! public static void execfile_flags(String name, PyObject globals, PyObject locals,CompilerFlags cflags) *************** *** 310,314 **** execfile(name, globals, globals); } ! public static void execfile(String name) { execfile(name, null, null); --- 310,314 ---- execfile(name, globals, globals); } ! public static void execfile(String name) { execfile(name, null, null); *************** *** 581,585 **** * Open a file read-only. * @param name the file to open. ! * @exception java.io.IOException */ public static PyFile open(String name) throws java.io.IOException { --- 581,585 ---- * Open a file read-only. * @param name the file to open. ! * @exception java.io.IOException */ public static PyFile open(String name) throws java.io.IOException { *************** *** 591,595 **** * @param name name of the file to open. * @param mode open mode of the file. Use "r", "w", "r+", "w+" and "a". ! * @exception java.io.IOException */ public static PyFile open(String name, String mode) --- 591,595 ---- * @param name name of the file to open. * @param mode open mode of the file. Use "r", "w", "r+", "w+" and "a". ! * @exception java.io.IOException */ public static PyFile open(String name, String mode) *************** *** 604,608 **** * @param mode open mode of the file. Use "r", "w", "r+", "w+" and "a". * @param bufsize size of the internal buffer. Not currently used. ! * @exception java.io.IOException */ public static PyFile open(String name, String mode, int bufsize) --- 604,608 ---- * @param mode open mode of the file. Use "r", "w", "r+", "w+" and "a". * @param bufsize size of the internal buffer. Not currently used. ! * @exception java.io.IOException */ public static PyFile open(String name, String mode, int bufsize) Index: imp.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/core/imp.java,v retrieving revision 2.55 retrieving revision 2.56 diff -C2 -d -r2.55 -r2.56 *** imp.java 2001/11/27 11:22:07 2.55 --- imp.java 2001/11/27 13:51:37 2.56 *************** *** 287,291 **** String pyName = entryName +".py"; String className = entryName +"$py.class"; ! try { String sourceName = entryName + "/__init__.py"; --- 287,291 ---- String pyName = entryName +".py"; String className = entryName +"$py.class"; ! try { String sourceName = entryName + "/__init__.py"; *************** *** 306,310 **** } } ! ZipEntry pyEntry = zipArchive.getEntry(pyName); ZipEntry classEntry = zipArchive.getEntry(className); --- 306,310 ---- } } ! ZipEntry pyEntry = zipArchive.getEntry(pyName); ZipEntry classEntry = zipArchive.getEntry(className); *************** *** 337,341 **** return null; } ! private static boolean isSyspathArchive(PyObject entry, boolean isDir) { if (entry instanceof SyspathArchive) --- 337,341 ---- return null; } ! private static boolean isSyspathArchive(PyObject entry, boolean isDir) { if (entry instanceof SyspathArchive) *************** *** 389,393 **** } } ! PyObject ret = loadFromZipFile(name, modName, (SyspathArchive)entry); --- 389,393 ---- } } ! PyObject ret = loadFromZipFile(name, modName, (SyspathArchive)entry); *************** *** 497,501 **** Py.writeComment("import", "'" + name + "' not found (=> ImportError)"); return null; - } --- 497,500 ---- *************** *** 526,530 **** PyObject modules = Py.getSystemState().modules; PyObject ret = modules.__finditem__(fullName); ! if (ret != null) return ret; if (mod == null) { ret = load(name.intern(), Py.getSystemState().path); // ?? intern superfluous? --- 525,529 ---- PyObject modules = Py.getSystemState().modules; PyObject ret = modules.__finditem__(fullName); ! if (ret != null) return ret; if (mod == null) { ret = load(name.intern(), Py.getSystemState().path); // ?? intern superfluous? *************** *** 535,539 **** if (modules.__finditem__(fullName) == null) modules.__setitem__(fullName, ret); else ret = modules.__finditem__(fullName); ! return ret; } --- 534,538 ---- if (modules.__finditem__(fullName) == null) modules.__setitem__(fullName, ret); else ret = modules.__finditem__(fullName); ! return ret; } *************** *** 542,550 **** PyObject ret = import_next(null,parentNameBuffer,name); if (ret == null || ret == Py.None) throw Py.ImportError("no module named "+name); ! return ret; } ! // Hierarchy-recursively search for dotted name in mod; never returns null or None ! // ??pending: check if result is really a module/jpkg/jclass? private static PyObject import_logic(PyObject mod, StringBuffer parentNameBuffer, String dottedName) { int dot = 0; --- 541,549 ---- PyObject ret = import_next(null,parentNameBuffer,name); if (ret == null || ret == Py.None) throw Py.ImportError("no module named "+name); ! return ret; } ! // Hierarchy-recursively search for dotted name in mod; never returns null or None ! // ??pending: check if result is really a module/jpkg/jclass? private static PyObject import_logic(PyObject mod, StringBuffer parentNameBuffer, String dottedName) { int dot = 0; *************** *** 590,594 **** } parentNameBuffer = new StringBuffer(""); ! topMod = import_first(firstName,parentNameBuffer); // could throw ImportError } PyObject mod = topMod; --- 589,593 ---- } parentNameBuffer = new StringBuffer(""); ! topMod = import_first(firstName,parentNameBuffer); // could throw ImportError } PyObject mod = topMod; *************** *** 606,610 **** return import_name(name,top,modDict); } ! /** * Called from jpython generated code when a statement like "import spam" --- 605,609 ---- return import_name(name,top,modDict); } ! /** * Called from jpython generated code when a statement like "import spam" Index: parser.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/core/parser.java,v retrieving revision 2.12 retrieving revision 2.13 diff -C2 -d -r2.12 -r2.13 *** parser.java 2001/10/28 17:13:44 2.12 --- parser.java 2001/11/27 13:51:37 2.13 *************** *** 97,101 **** reader = new InputStreamReader(istream); } ! //if (Options.fixMacReaderBug); reader = new FixMacReaderBug(reader); --- 97,101 ---- reader = new InputStreamReader(istream); } ! //if (Options.fixMacReaderBug); reader = new FixMacReaderBug(reader); |