From: <th...@us...> - 2009-03-30 07:17:49
|
Revision: 6118 http://jython.svn.sourceforge.net/jython/?rev=6118&view=rev Author: thobes Date: 2009-03-30 07:17:38 +0000 (Mon, 30 Mar 2009) Log Message: ----------- Fix to bug 1294. Modified Paths: -------------- trunk/jython/src/org/python/core/Py.java Modified: trunk/jython/src/org/python/core/Py.java =================================================================== --- trunk/jython/src/org/python/core/Py.java 2009-03-29 23:21:00 UTC (rev 6117) +++ trunk/jython/src/org/python/core/Py.java 2009-03-30 07:17:38 UTC (rev 6118) @@ -1219,6 +1219,19 @@ public static void exec(PyObject o, PyObject globals, PyObject locals) { PyCode code; int flags = 0; + if (o instanceof PyTuple) { + PyTuple tuple = (PyTuple) o; + int len = tuple.__len__(); + if ((globals == null || globals.equals(None)) + && (locals == null || locals.equals(None)) + && (len >= 2 && len <= 3)) { + o = tuple.__getitem__(0); + globals = tuple.__getitem__(1); + if (len == 3) { + locals = tuple.__getitem__(2); + } + } + } if (o instanceof PyCode) { code = (PyCode) o; if (locals == null && o instanceof PyBaseCode && ((PyBaseCode) o).hasFreevars()) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |