From: <zy...@us...> - 2009-02-06 07:42:18
|
Revision: 6017 http://jython.svn.sourceforge.net/jython/?rev=6017&view=rev Author: zyasoft Date: 2009-02-06 07:42:15 +0000 (Fri, 06 Feb 2009) Log Message: ----------- Fixed slice, exec support. Modified Paths: -------------- branches/pbcvm/src/org/python/core/PyBytecode.java Modified: branches/pbcvm/src/org/python/core/PyBytecode.java =================================================================== --- branches/pbcvm/src/org/python/core/PyBytecode.java 2009-02-06 07:07:45 UTC (rev 6016) +++ branches/pbcvm/src/org/python/core/PyBytecode.java 2009-02-06 07:42:15 UTC (rev 6017) @@ -566,8 +566,8 @@ case Opcode.STORE_SLICE + 1: case Opcode.STORE_SLICE + 2: case Opcode.STORE_SLICE + 3: { - PyObject stop = (((opcode - Opcode.SLICE) & 2) != 0) ? stack.pop() : null; - PyObject start = (((opcode - Opcode.SLICE) & 1) != 0) ? stack.pop() : null; + PyObject stop = (((opcode - Opcode.STORE_SLICE) & 2) != 0) ? stack.pop() : null; + PyObject start = (((opcode - Opcode.STORE_SLICE) & 1) != 0) ? stack.pop() : null; PyObject obj = stack.pop(); PyObject value = stack.pop(); obj.__setslice__(start, stop, value); @@ -578,8 +578,8 @@ case Opcode.DELETE_SLICE + 1: case Opcode.DELETE_SLICE + 2: case Opcode.DELETE_SLICE + 3: { - PyObject stop = (((opcode - Opcode.SLICE) & 2) != 0) ? stack.pop() : null; - PyObject start = (((opcode - Opcode.SLICE) & 1) != 0) ? stack.pop() : null; + PyObject stop = (((opcode - Opcode.DELETE_SLICE) & 2) != 0) ? stack.pop() : null; + PyObject start = (((opcode - Opcode.DELETE_SLICE) & 1) != 0) ? stack.pop() : null; PyObject obj = stack.pop(); obj.__delslice__(start, stop); break; @@ -662,16 +662,7 @@ PyObject locals = stack.pop(); PyObject globals = stack.pop(); PyObject code = stack.pop(); - - if ((locals == null || locals == Py.None) && - (globals == null || globals == Py.None)) { - throw Py.SystemError("globals and locals cannot be NULL"); - } Py.exec(code, globals, locals); - - if (!(globals.__finditem__("__builtins__").__nonzero__())) { - globals.__setitem__("__builtins__", f.f_builtins); - } break; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |