From: Samuele P. <ped...@us...> - 2001-03-08 23:42:07
|
Update of /cvsroot/jython/jython/org/python/core In directory usw-pr-cvs1:/tmp/cvs-serv850/core Modified Files: Py.java PyCode.java PyFrame.java PyFunction.java PyTableCode.java Added Files: PyCell.java Log Message: nested scopes *future* support (as CPython 2.1) --- NEW FILE --- package org.python.core; public class PyCell extends PyObject { // ?? pending repr? public PyObject ob_ref; } Index: Py.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/core/Py.java,v retrieving revision 2.40 retrieving revision 2.41 diff -C2 -r2.40 -r2.41 *** Py.java 2001/03/04 18:08:02 2.40 --- Py.java 2001/03/08 23:43:51 2.41 *************** *** 240,251 **** warning(RuntimeWarning, message); } ! public static void warning(PyObject category, String message) { PyObject func = null; ! PyObject mod = __builtin__.__import__("warnings"); if (mod != null) func = mod.__getattr__("warn"); if (func == null) { ! System.err.println("warning: " + message); return; } else { --- 240,273 ---- warning(RuntimeWarning, message); } ! ! private static PyObject warnings_mod; ! private static PyObject importWarnings() { ! if (warnings_mod != null) return warnings_mod; ! PyObject mod; ! try { ! mod = __builtin__.__import__("warnings"); ! } catch(PyException e) { ! if (matchException(e,ImportError)) { ! return null; ! } ! throw e; ! } ! warnings_mod = mod; ! return mod; ! } ! ! private static String warn_hcategory(PyObject category) { ! PyObject name = category.__findattr__("__name__"); ! if (name != null) return "["+name+"]"; ! return "[warning]"; ! } ! public static void warning(PyObject category, String message) { PyObject func = null; ! PyObject mod = importWarnings(); if (mod != null) func = mod.__getattr__("warn"); if (func == null) { ! System.err.println(warn_hcategory(category) + ": " + message); return; } else { *************** *** 254,258 **** --- 276,295 ---- } + public static void warning(PyObject category, String message,String filename,int lineno, String module, PyObject registry) { + PyObject func = null; + PyObject mod = importWarnings(); + if (mod != null) + func = mod.__getattr__("warn_explicit"); + if (func == null) { + System.err.println(filename + ":" + lineno + ":" + warn_hcategory(category) + ": " + message); + 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); + } + } + public static PyObject JavaError; public static PyException JavaError(Throwable t) { *************** *** 396,399 **** --- 433,464 ---- } + // nested scopes: String[] cellvars,String[] freevars,int xxx_npurecell + + public static PyCode newCode(int argcount, String varnames[], + String filename, String name, + boolean args, boolean keywords, + PyFunctionTable funcs, int func_id, + String[] cellvars,String[] freevars,int xxx_npurecell) + { + return new PyTableCode(argcount, varnames, + filename, name, 0, args, keywords, funcs, + func_id, cellvars, freevars, xxx_npurecell); + } + + public static PyCode newCode(int argcount, String varnames[], + String filename, String name, + int firstlineno, + boolean args, boolean keywords, + PyFunctionTable funcs, int func_id, + String[] cellvars,String[] freevars,int xxx_npurecell) + + { + return new PyTableCode(argcount, varnames, + filename, name, firstlineno, args, keywords, + funcs, func_id, cellvars, freevars, xxx_npurecell); + } + + // -- + public static PyCode newCode(int argcount, String varnames[], String filename, String name, *************** *** 423,427 **** 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); --- 488,492 ---- 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); *************** *** 1303,1312 **** PyCode code, PyObject doc) { ! return makeClass(name, bases, code, doc, null); } public static PyObject makeClass(String name, PyObject[] bases, PyCode code, PyObject doc, ! Class proxyClass) { PyFrame frame = getFrame(); --- 1368,1391 ---- PyCode code, PyObject doc) { ! return makeClass(name, bases, code, doc, null, null); } + + public static PyObject makeClass(String name, PyObject[] bases, + PyCode code, PyObject doc,PyObject[] closure_cells) + { + return makeClass(name, bases, code, doc, null, closure_cells); + } + public static PyObject makeClass(String name, PyObject[] bases, PyCode code, PyObject doc, ! Class proxyClass) { ! return makeClass(name, bases, code, doc, proxyClass, null); ! } ! ! ! public static PyObject makeClass(String name, PyObject[] bases, ! PyCode code, PyObject doc, ! Class proxyClass,PyObject[] closure_cells) { PyFrame frame = getFrame(); *************** *** 1314,1318 **** PyObject dict = code.call(Py.EmptyObjects, Py.NoKeywords, ! globals, Py.EmptyObjects); if (doc != null) dict.__setitem__("__doc__", doc); --- 1393,1397 ---- PyObject dict = code.call(Py.EmptyObjects, Py.NoKeywords, ! globals, Py.EmptyObjects,new PyTuple(closure_cells)); if (doc != null) dict.__setitem__("__doc__", doc); *************** *** 1530,1534 **** } ! public PyObject call(PyFrame frame) { System.out.println("call #1"); return Py.None; --- 1609,1613 ---- } ! public PyObject call(PyFrame frame, PyObject closure) { System.out.println("call #1"); return Py.None; *************** *** 1536,1540 **** public PyObject call(PyObject args[], String keywords[], ! PyObject globals, PyObject[] defaults) { return func.__call__(args, keywords); --- 1615,1619 ---- public PyObject call(PyObject args[], String keywords[], ! PyObject globals, PyObject[] defaults, PyObject closure) { return func.__call__(args, keywords); *************** *** 1543,1552 **** public PyObject call(PyObject self, PyObject args[], String keywords[], ! PyObject globals, PyObject[] defaults) { return func.__call__(self, args, keywords); } ! public PyObject call(PyObject globals, PyObject[] defaults) { return func.__call__(); --- 1622,1631 ---- public PyObject call(PyObject self, PyObject args[], String keywords[], ! PyObject globals, PyObject[] defaults, PyObject closure) { return func.__call__(self, args, keywords); } ! public PyObject call(PyObject globals, PyObject[] defaults, PyObject closure) { return func.__call__(); *************** *** 1554,1558 **** public PyObject call(PyObject arg1, PyObject globals, ! PyObject[] defaults) { return func.__call__(arg1); --- 1633,1637 ---- public PyObject call(PyObject arg1, PyObject globals, ! PyObject[] defaults, PyObject closure) { return func.__call__(arg1); *************** *** 1560,1564 **** public PyObject call(PyObject arg1, PyObject arg2, ! PyObject globals, PyObject[] defaults) { return func.__call__(arg1, arg2); --- 1639,1643 ---- public PyObject call(PyObject arg1, PyObject arg2, ! PyObject globals, PyObject[] defaults, PyObject closure) { return func.__call__(arg1, arg2); *************** *** 1566,1570 **** public PyObject call(PyObject arg1, PyObject arg2, PyObject arg3, ! PyObject globals, PyObject[] defaults) { return func.__call__(arg1, arg2, arg3); --- 1645,1649 ---- public PyObject call(PyObject arg1, PyObject arg2, PyObject arg3, ! PyObject globals, PyObject[] defaults, PyObject closure) { return func.__call__(arg1, arg2, arg3); *************** *** 1573,1577 **** /** ! * A function object wrapper for a java method which comply with the * PyArgsKeywordsCall standard. */ --- 1652,1656 ---- /** ! * A function object wrapper for a java method which comply with the * PyArgsKeywordsCall standard. */ *************** *** 1605,1607 **** throw Py.TypeError("java function not settable: "+method.getName()); } ! } \ No newline at end of file --- 1684,1686 ---- throw Py.TypeError("java function not settable: "+method.getName()); } ! } Index: PyCode.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/core/PyCode.java,v retrieving revision 2.4 retrieving revision 2.5 diff -C2 -r2.4 -r2.5 *** PyCode.java 2001/02/25 16:43:19 2.4 --- PyCode.java 2001/03/08 23:43:51 2.5 *************** *** 8,30 **** { public String co_name; - abstract public PyObject call(PyFrame frame); - abstract public PyObject call(PyObject args[], String keywords[], ! PyObject globals, PyObject[] defaults); abstract public PyObject call(PyObject self, PyObject args[], String keywords[], ! PyObject globals, PyObject[] defaults); ! abstract public PyObject call(PyObject globals, PyObject[] defaults); abstract public PyObject call(PyObject arg1, PyObject globals, ! PyObject[] defaults); abstract public PyObject call(PyObject arg1, PyObject arg2, ! PyObject globals, PyObject[] defaults); abstract public PyObject call(PyObject arg1, PyObject arg2, PyObject arg3, ! PyObject globals, PyObject[] defaults); } --- 8,33 ---- { public String co_name; + + abstract public PyObject call(PyFrame frame, PyObject closure); + + public PyObject call(PyFrame frame) { return call(frame,null); } // commodity abstract public PyObject call(PyObject args[], String keywords[], ! PyObject globals, PyObject[] defaults, PyObject closure); abstract public PyObject call(PyObject self, PyObject args[], String keywords[], ! PyObject globals, PyObject[] defaults,PyObject closure); ! abstract public PyObject call(PyObject globals, PyObject[] defaults, PyObject closure); abstract public PyObject call(PyObject arg1, PyObject globals, ! PyObject[] defaults, PyObject closure); abstract public PyObject call(PyObject arg1, PyObject arg2, ! PyObject globals, PyObject[] defaults, PyObject closure); abstract public PyObject call(PyObject arg1, PyObject arg2, PyObject arg3, ! PyObject globals, PyObject[] defaults, PyObject closure); ! } Index: PyFrame.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/core/PyFrame.java,v retrieving revision 2.6 retrieving revision 2.7 diff -C2 -r2.6 -r2.7 *** PyFrame.java 2001/02/25 16:47:44 2.6 --- PyFrame.java 2001/03/08 23:43:51 2.7 *************** *** 16,20 **** public PyObject f_builtins; public PyObject[] f_fastlocals; ! // an interface to functions suitable for tracing, e.g. via sys.settrace() public TraceFunction tracefunc; --- 16,23 ---- public PyObject f_builtins; public PyObject[] f_fastlocals; ! public PyCell[] f_env; // nested scopes: cell + free env ! public int f_ncells; ! public int f_nfreevars; ! // an interface to functions suitable for tracing, e.g. via sys.settrace() public TraceFunction tracefunc; *************** *** 37,41 **** // This needs work to be efficient with multiple interpreter states if (locals == null && code != null && code.co_varnames.length > 0) { ! f_fastlocals = new PyObject[code.co_varnames.length]; } } --- 40,50 ---- // This needs work to be efficient with multiple interpreter states if (locals == null && code != null && code.co_varnames.length > 0) { ! f_fastlocals = new PyObject[code.co_varnames.length-code.xxx_npurecell]; // internal: may change ! } ! if (code != null) { // reserve space for env ! int env_sz = 0; ! if (code.co_freevars != null) env_sz += (f_nfreevars = code.co_freevars.length); ! if (code.co_cellvars != null) env_sz += (f_ncells = code.co_cellvars.length); ! if (env_sz > 0) f_env = new PyCell[env_sz]; } } *************** *** 136,140 **** public PyObject getlocal(String index) { ! //System.err.println("getlocal: "+index); if (f_locals == null) getf_locals(); --- 145,149 ---- public PyObject getlocal(String index) { ! // System.err.println("getlocal: "+index); if (f_locals == null) getf_locals(); *************** *** 143,147 **** return ret; ! throw Py.NameError("local: '"+index+"'"); //return getglobal(index); } --- 152,156 ---- return ret; ! throw Py.UnboundLocalError("local: '"+index+"'"); //return getglobal(index); } *************** *** 205,207 **** --- 214,240 ---- 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; + if (obj != null) return obj; + String name; + 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.10 retrieving revision 2.11 diff -C2 -r2.10 -r2.11 *** PyFunction.java 2001/03/04 18:13:56 2.10 --- PyFunction.java 2001/03/08 23:43:51 2.11 *************** *** 14,20 **** public PyCode func_code; public PyObject __dict__; public PyFunction(PyObject globals, PyObject[] defaults, PyCode code, ! PyObject doc) { func_globals = globals; --- 14,21 ---- public PyCode func_code; public PyObject __dict__; + public PyObject func_closure; // nested scopes: closure public PyFunction(PyObject globals, PyObject[] defaults, PyCode code, ! PyObject doc,PyObject[] closure_cells) { func_globals = globals; *************** *** 26,39 **** func_defaults = defaults; func_code = code; } public PyFunction(PyObject globals, PyObject[] defaults, PyCode code) { ! this(globals, defaults, code, null); } private static final String[] __members__ = { "__doc__", "func_doc", "__name__", "func_name", "__dict__", ! "func_globals", "func_defaults", "func_code" }; --- 27,56 ---- func_defaults = defaults; func_code = code; + if (closure_cells != null) { + func_closure = new PyTuple(closure_cells); + } else { + func_closure = null; + } } + public PyFunction(PyObject globals, PyObject[] defaults, PyCode code, + PyObject doc) { + 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); + } + private static final String[] __members__ = { "__doc__", "func_doc", "__name__", "func_name", "__dict__", ! "func_globals", "func_defaults", "func_code", ! "func_closure" }; *************** *** 61,64 **** --- 78,87 ---- if (name == "func_doc" || name == "__doc__") __doc__ = value; + else if (name == "func_closure") { + if (!(value instanceof PyTuple)) { + throw Py.TypeError("func_closure must be set to a tuple"); + } + func_closure = value; + } // not yet implemented: // func_code *************** *** 111,114 **** --- 134,141 ---- if (name == "func_name") return new PyString(__name__); + if (name == "func_closure") { + if (func_closure != null) return func_closure; + return Py.None; + } if (name == "func_defaults") { if (func_defaults.length == 0) *************** *** 138,155 **** public PyObject __call__() { ! return func_code.call(func_globals, func_defaults); } public PyObject __call__(PyObject arg) { ! return func_code.call(arg, func_globals, func_defaults); } public PyObject __call__(PyObject arg1, PyObject arg2) { ! return func_code.call(arg1, arg2, func_globals, func_defaults); } public PyObject __call__(PyObject arg1, PyObject arg2, PyObject arg3) { ! return func_code.call(arg1, arg2, arg3, func_globals, func_defaults); } public PyObject __call__(PyObject[] args, String[] keywords) { ! return func_code.call(args, keywords, func_globals, func_defaults); } public PyObject __call__(PyObject arg1, PyObject[] args, --- 165,182 ---- public PyObject __call__() { ! return func_code.call(func_globals, func_defaults, func_closure); } public PyObject __call__(PyObject arg) { ! return func_code.call(arg, func_globals, func_defaults, func_closure); } public PyObject __call__(PyObject arg1, PyObject arg2) { ! return func_code.call(arg1, arg2, func_globals, func_defaults, func_closure); } public PyObject __call__(PyObject arg1, PyObject arg2, PyObject arg3) { ! return func_code.call(arg1, arg2, arg3, func_globals, func_defaults, func_closure); } public PyObject __call__(PyObject[] args, String[] keywords) { ! return func_code.call(args, keywords, func_globals, func_defaults, func_closure); } public PyObject __call__(PyObject arg1, PyObject[] args, *************** *** 157,161 **** { return func_code.call(arg1, args, keywords, func_globals, ! func_defaults); } public String toString() { --- 184,188 ---- { return func_code.call(arg1, args, keywords, func_globals, ! func_defaults, func_closure); } public String toString() { Index: PyTableCode.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/core/PyTableCode.java,v retrieving revision 2.11 retrieving revision 2.12 diff -C2 -r2.11 -r2.12 *** PyTableCode.java 2001/02/25 16:51:51 2.11 --- PyTableCode.java 2001/03/08 23:43:51 2.12 *************** *** 13,16 **** --- 13,19 ---- public int co_firstlineno = -1; public String co_varnames[]; + public String co_cellvars[]; + public int xxx_npurecell; // internal: may change + public String co_freevars[]; public String co_filename; public int co_flags; *************** *** 18,22 **** PyFunctionTable funcs; int func_id; ! public PyTableCode(int argcount, String varnames[], String filename, String name, --- 21,26 ---- PyFunctionTable funcs; int func_id; ! ! public PyTableCode(int argcount, String varnames[], String filename, String name, *************** *** 25,32 **** --- 29,49 ---- PyFunctionTable funcs, int func_id) { + this(argcount,varnames,filename,name,firstlineno,args,keywords,funcs,func_id,null,null,0); + } + + public PyTableCode(int argcount, String varnames[], + String filename, String name, + int firstlineno, + boolean args, boolean keywords, + PyFunctionTable funcs, int func_id, + String[] cellvars,String[] freevars,int xxx_npurecell) // may change + { co_argcount = nargs = argcount; co_varnames = varnames; co_filename = filename; co_firstlineno = firstlineno; + co_cellvars = cellvars; + co_freevars = freevars; + this.xxx_npurecell = xxx_npurecell; this.args = args; co_name = name; *************** *** 47,51 **** "co_name", "co_argcount", "co_varnames", "co_filename", "co_firstlineno", ! "co_flags" // not supported: co_nlocals, co_code, co_consts, co_names, // co_lnotab, co_stacksize --- 64,68 ---- "co_name", "co_argcount", "co_varnames", "co_filename", "co_firstlineno", ! "co_flags","co_cellvars","co_freevars" // not supported: co_nlocals, co_code, co_consts, co_names, // co_lnotab, co_stacksize *************** *** 75,90 **** } public PyObject __findattr__(String name) { // have to craft co_varnames specially ! if (name == "co_varnames") { ! PyString varnames[] = new PyString[co_varnames.length]; ! for (int i = 0; i < co_varnames.length; i++) ! varnames[i] = new PyString(co_varnames[i]); ! return new PyTuple(varnames); ! } return super.__findattr__(name); } ! public PyObject call(PyFrame frame) { // System.err.println("tablecode call: "+co_name); ThreadState ts = Py.getThreadState(); --- 92,114 ---- } + private static PyTuple toPyStringTuple(String[] ar) { + if (ar == null) return Py.EmptyTuple; + int sz = ar.length; + PyString[] pystr = new PyString[sz]; + for (int i = 0; i < sz; i++) { + pystr[i] = new PyString(ar[i]); + } + return new PyTuple(pystr); + } + public PyObject __findattr__(String name) { // have to craft co_varnames specially ! if (name == "co_varnames") return toPyStringTuple(co_varnames); ! if (name == "co_cellvars") return toPyStringTuple(co_cellvars); ! if (name == "co_freevars") return toPyStringTuple(co_freevars); return super.__findattr__(name); } ! public PyObject call(PyFrame frame, PyObject closure) { // System.err.println("tablecode call: "+co_name); ThreadState ts = Py.getThreadState(); *************** *** 108,111 **** --- 132,149 ---- } } + // nested scopes: setup env with closure + int env_j = 0; + int ncells = frame.f_ncells; + int nfreevars = frame.f_nfreevars; + PyCell[] env = frame.f_env; + PyTuple freevars = (PyTuple)closure; + for (int i = 0; i < ncells; i++,env_j++) { + env[env_j] = new PyCell(); + } + for (int i=0; i<nfreevars; i++,env_j++) { + env[env_j] = (PyCell)freevars.get(i); + } + + ts.frame = frame; *************** *** 199,252 **** } ! public PyObject call(PyObject globals, PyObject[] defaults) { if (co_argcount != 0 || args || keywords) ! return call(Py.EmptyObjects, Py.NoKeywords, globals, defaults); PyFrame frame = new PyFrame(this, globals); ! return call(frame); } ! public PyObject call(PyObject arg1, PyObject globals, PyObject[] defaults) { if (co_argcount != 1 || args || keywords) return call(new PyObject[] {arg1}, ! Py.NoKeywords, globals, defaults); PyFrame frame = new PyFrame(this, globals); frame.f_fastlocals[0] = arg1; ! return call(frame); } public PyObject call(PyObject arg1, PyObject arg2, PyObject globals, ! PyObject[] defaults) { if (co_argcount != 2 || args || keywords) return call(new PyObject[] {arg1, arg2}, ! Py.NoKeywords, globals, defaults); PyFrame frame = new PyFrame(this, globals); frame.f_fastlocals[0] = arg1; frame.f_fastlocals[1] = arg2; ! return call(frame); } public PyObject call(PyObject arg1, PyObject arg2, PyObject arg3, ! PyObject globals, PyObject[] defaults) { if (co_argcount != 2 || args || keywords) return call(new PyObject[] {arg1, arg2, arg3}, ! Py.NoKeywords, globals, defaults); PyFrame frame = new PyFrame(this, globals); frame.f_fastlocals[0] = arg1; frame.f_fastlocals[1] = arg2; frame.f_fastlocals[2] = arg3; ! return call(frame); } public PyObject call(PyObject self, PyObject call_args[], String call_keywords[], PyObject globals, ! PyObject[] defaults) { PyObject[] os = new PyObject[call_args.length+1]; os[0] = (PyObject)self; System.arraycopy(call_args, 0, os, 1, call_args.length); ! return call(os, call_keywords, globals, defaults); } --- 237,290 ---- } ! public PyObject call(PyObject globals, PyObject[] defaults, PyObject closure) { if (co_argcount != 0 || args || keywords) ! return call(Py.EmptyObjects, Py.NoKeywords, globals, defaults, closure); PyFrame frame = new PyFrame(this, globals); ! return call(frame, closure); } ! public PyObject call(PyObject arg1, PyObject globals, PyObject[] defaults, PyObject closure) { if (co_argcount != 1 || args || keywords) return call(new PyObject[] {arg1}, ! Py.NoKeywords, globals, defaults, closure); PyFrame frame = new PyFrame(this, globals); frame.f_fastlocals[0] = arg1; ! return call(frame, closure); } public PyObject call(PyObject arg1, PyObject arg2, PyObject globals, ! PyObject[] defaults, PyObject closure) { if (co_argcount != 2 || args || keywords) return call(new PyObject[] {arg1, arg2}, ! Py.NoKeywords, globals, defaults, closure); PyFrame frame = new PyFrame(this, globals); frame.f_fastlocals[0] = arg1; frame.f_fastlocals[1] = arg2; ! return call(frame, closure); } public PyObject call(PyObject arg1, PyObject arg2, PyObject arg3, ! PyObject globals, PyObject[] defaults, PyObject closure) { if (co_argcount != 2 || args || keywords) return call(new PyObject[] {arg1, arg2, arg3}, ! Py.NoKeywords, globals, defaults, closure); PyFrame frame = new PyFrame(this, globals); frame.f_fastlocals[0] = arg1; frame.f_fastlocals[1] = arg2; frame.f_fastlocals[2] = arg3; ! return call(frame, closure); } public PyObject call(PyObject self, PyObject call_args[], String call_keywords[], PyObject globals, ! PyObject[] defaults, PyObject closure) { PyObject[] os = new PyObject[call_args.length+1]; os[0] = (PyObject)self; System.arraycopy(call_args, 0, os, 1, call_args.length); ! return call(os, call_keywords, globals, defaults, closure); } *************** *** 256,260 **** public PyObject call(PyObject call_args[], String call_keywords[], ! PyObject globals, PyObject[] defaults) { //Needs try except finally blocks --- 294,298 ---- public PyObject call(PyObject call_args[], String call_keywords[], ! PyObject globals, PyObject[] defaults, PyObject closure) { //Needs try except finally blocks *************** *** 348,352 **** } } ! return call(my_frame); } --- 386,390 ---- } } ! return call(my_frame, closure); } |