Skip to content

Commit 1937b4a

Browse files
committed
Don't wrap control flow exception if it gets there
1 parent 2551473 commit 1937b4a

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/nodes/statement/ExceptionHandlingStatementNode.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@
5757
import com.oracle.truffle.api.TruffleException;
5858
import com.oracle.truffle.api.TruffleLanguage;
5959
import com.oracle.truffle.api.frame.VirtualFrame;
60+
import com.oracle.truffle.api.nodes.ControlFlowException;
6061
import com.oracle.truffle.api.nodes.Node;
6162
import com.oracle.truffle.api.profiles.ConditionProfile;
6263
import com.oracle.truffle.api.profiles.LoopConditionProfile;
@@ -197,6 +198,9 @@ public static PException wrapJavaException(Throwable e, Node node, PBaseExceptio
197198
}
198199

199200
protected PException wrapJavaExceptionIfApplicable(Throwable e) {
201+
if (e instanceof ControlFlowException) {
202+
return null;
203+
}
200204
if (shouldCatchAllExceptions() && (e instanceof Exception || e instanceof AssertionError)) {
201205
return wrapJavaException(e, this, factory().createBaseException(SystemError, "%m", new Object[]{e}));
202206
}

0 commit comments

Comments
 (0)