Skip to content

Commit 8854af0

Browse files
msimacektomasstupka
authored andcommitted
Fix traceback for with statement
1 parent 4426118 commit 8854af0

File tree

1 file changed

+3
-1
lines changed
  • graalpython/com.oracle.graal.python/src/com/oracle/graal/python/nodes/bytecode

1 file changed

+3
-1
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/nodes/bytecode/ExitWithNode.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,9 @@ int exit(Frame virtualFrame, int stackTopIn, Frame localFrame,
9393
Object excTraceback = getTracebackNode.execute(pythonException);
9494
Object result = callExit.execute(virtualFrame, exit, contextManager, excType, pythonException, excTraceback);
9595
if (!isTrueNode.execute(virtualFrame, result)) {
96-
if (exception instanceof AbstractTruffleException) {
96+
if (exception instanceof PException) {
97+
throw ((PException) exception).getExceptionForReraise();
98+
} else if (exception instanceof AbstractTruffleException) {
9799
throw (AbstractTruffleException) exception;
98100
} else {
99101
CompilerDirectives.transferToInterpreterAndInvalidate();

0 commit comments

Comments
 (0)