Update of /cvsroot/jython/jython/org/python/compiler
In directory slayer.i.sourceforge.net:/tmp/cvs-serv5941/compiler
Modified Files:
CodeCompiler.java
Log Message:
Fix bug 122838. A traceback object is also created when catching
an exception in a try: finally: statement.
Index: CodeCompiler.java
===================================================================
RCS file: /cvsroot/jython/jython/org/python/compiler/CodeCompiler.java,v
retrieving revision 2.8
retrieving revision 2.9
diff -C2 -r2.8 -r2.9
*** CodeCompiler.java 2000/12/06 20:55:30 2.8
--- CodeCompiler.java 2000/12/12 21:27:27 2.9
***************
*** 975,978 ****
--- 975,979 ----
}
+ public int add_traceback;
public Object tryFinally(SimpleNode trySuite, SimpleNode finallySuite)
throws Exception
***************
*** 1009,1012 ****
--- 1010,1024 ----
int excLocal = code.getLocal();
code.astore(excLocal);
+
+ code.aload(excLocal);
+ loadFrame();
+
+ if (mrefs.add_traceback == 0) {
+ mrefs.add_traceback = code.pool.Methodref(
+ "org/python/core/Py", "addTraceback",
+ "(Ljava/lang/Throwable;Lorg/python/core/PyFrame;)V");
+ }
+ code.invokestatic(mrefs.add_traceback);
+
code.jsr(finallyStart);
code.aload(excLocal);
|