From: Samuele P. <ped...@us...> - 2001-05-27 18:49:18
|
Update of /cvsroot/jython/jython/org/python/util In directory usw-pr-cvs1:/tmp/cvs-serv24200/util Modified Files: InteractiveInterpreter.java PythonInterpreter.java Log Message: ** nested scopes (2) ** completes nested scopes support in interpreter: now nested scopes semantic settings are inherited trough exec, execfile, etc ... plus: assert now correctly get __debug__ as a global Index: InteractiveInterpreter.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/util/InteractiveInterpreter.java,v retrieving revision 2.3 retrieving revision 2.4 diff -C2 -r2.3 -r2.4 *** InteractiveInterpreter.java 2000/12/04 21:18:59 2.3 --- InteractiveInterpreter.java 2001/05/27 18:49:15 2.4 *************** *** 8,14 **** --- 8,16 ---- public InteractiveInterpreter() { super(); + cflags = new CompilerFlags(); } public InteractiveInterpreter(PyObject locals) { super(locals); + cflags = new CompilerFlags(); } *************** *** 46,51 **** PyObject code; try { ! code = org.python.modules.codeop.compile_command( ! source, filename, symbol); } catch (PyException exc) { if (Py.matchException(exc, Py.SyntaxError)) { --- 48,53 ---- PyObject code; try { ! code = org.python.modules.codeop.compile_command_flags( ! source, filename, symbol,cflags); } catch (PyException exc) { if (Py.matchException(exc, Py.SyntaxError)) { Index: PythonInterpreter.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/util/PythonInterpreter.java,v retrieving revision 2.6 retrieving revision 2.7 diff -C2 -r2.6 -r2.7 *** PythonInterpreter.java 2001/01/15 18:27:38 2.6 --- PythonInterpreter.java 2001/05/27 18:49:15 2.7 *************** *** 17,20 **** --- 17,22 ---- PyObject locals; + protected CompilerFlags cflags = null; + /** * Initialize the jython runtime. This method should only be *************** *** 133,137 **** public void exec(String s) { setState(); ! Py.exec(new PyString(s), locals, locals); } --- 135,139 ---- public void exec(String s) { setState(); ! Py.exec(Py.compile_flags(s, "<string>", "exec",cflags), locals, locals); } *************** *** 153,157 **** public void execfile(String s) { setState(); ! __builtin__.execfile(s, locals); } --- 155,159 ---- public void execfile(String s) { setState(); ! __builtin__.execfile_flags(s, locals, locals, cflags); } *************** *** 162,166 **** public void execfile(java.io.InputStream s, String name) { setState(); ! Py.runCode(Py.compile(s, name, "exec"), locals, locals); } --- 164,168 ---- public void execfile(java.io.InputStream s, String name) { setState(); ! Py.runCode(Py.compile_flags(s, name, "exec",cflags), locals, locals); } |