From: <zy...@us...> - 2009-09-07 21:48:27
|
Revision: 6763 http://jython.svn.sourceforge.net/jython/?rev=6763&view=rev Author: zyasoft Date: 2009-09-07 21:48:20 +0000 (Mon, 07 Sep 2009) Log Message: ----------- CodeCompiler#visitAssert now looks up the AssertionError by using PyFrame#getglobal, so user code can redefine the behavior of assert. Fixes #1461 Bumped bytecode magic. Modified Paths: -------------- trunk/jython/NEWS trunk/jython/src/org/python/compiler/CodeCompiler.java trunk/jython/src/org/python/core/imp.java Modified: trunk/jython/NEWS =================================================================== --- trunk/jython/NEWS 2009-09-07 20:41:45 UTC (rev 6762) +++ trunk/jython/NEWS 2009-09-07 21:48:20 UTC (rev 6763) @@ -3,6 +3,7 @@ Jython 2.5.1rc2 Bugs Fixed - [ 1079 ] fixed regression on issue: twisted.python.threadable module: missing attribute '_RLock' + - [ 1461 ] assert statement should lookup AssertionError using getglobal Jython 2.5.1rc1 New Features Modified: trunk/jython/src/org/python/compiler/CodeCompiler.java =================================================================== --- trunk/jython/src/org/python/compiler/CodeCompiler.java 2009-09-07 20:41:45 UTC (rev 6762) +++ trunk/jython/src/org/python/compiler/CodeCompiler.java 2009-09-07 21:48:20 UTC (rev 6763) @@ -964,8 +964,9 @@ getNone(); } - /* Push exception type onto stack(Py.AssertionError) */ - code.getstatic("org/python/core/Py", "AssertionError", "Lorg/python/core/PyObject;"); + /* Push exception type onto stack(AssertionError) */ + loadFrame(); + emitGetGlobal("AssertionError"); code.swap(); // The type is the first argument, but the message could be a yield Modified: trunk/jython/src/org/python/core/imp.java =================================================================== --- trunk/jython/src/org/python/core/imp.java 2009-09-07 20:41:45 UTC (rev 6762) +++ trunk/jython/src/org/python/core/imp.java 2009-09-07 21:48:20 UTC (rev 6763) @@ -21,7 +21,7 @@ private static final String UNKNOWN_SOURCEFILE = "<unknown>"; - private static final int APIVersion = 25; + private static final int APIVersion = 26; public static final int NO_MTIME = -1; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |