Skip to content

Commit 48d79e3

Browse files
committed
TryExceptNode: catch Exception instead of Throwable
1 parent 815d7b6 commit 48d79e3

File tree

1 file changed

+6
-6
lines changed
  • graalpython/com.oracle.graal.python/src/com/oracle/graal/python/nodes/statement

1 file changed

+6
-6
lines changed

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -62,27 +62,27 @@ public Object execute(VirtualFrame frame) {
6262
} catch (PException ex) {
6363
catchException(frame, ex);
6464
return PNone.NONE;
65-
} catch (Throwable t) {
65+
} catch (Exception e) {
6666
if (!seenException) {
6767
CompilerDirectives.transferToInterpreterAndInvalidate();
6868
seenException = true;
6969
}
7070

7171
if (PythonOptions.getOption(getContext(), CatchAllExceptions)) {
72-
if (t instanceof ControlFlowException) {
73-
throw t;
72+
if (e instanceof ControlFlowException) {
73+
throw e;
7474
} else {
75-
PException pe = new PException(getBaseException(t), this);
75+
PException pe = new PException(getBaseException(e), this);
7676
try {
7777
catchException(frame, pe);
7878
} catch (PException pe_thrown) {
7979
if (pe_thrown != pe) {
80-
throw t;
80+
throw e;
8181
}
8282
}
8383
}
8484
} else {
85-
throw t;
85+
throw e;
8686
}
8787
}
8888
return orelse.execute(frame);

0 commit comments

Comments
 (0)