Skip to content

Commit 1326e2b

Browse files
committed
Avoid blacklisted method
1 parent 6fc08f1 commit 1326e2b

File tree

1 file changed

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

1 file changed

+9
-4
lines changed

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

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -141,10 +141,7 @@ public void executeVoid(VirtualFrame frame) {
141141
if (shouldCatchAll) {
142142
PException pe = PException.fromObject(getBaseException(e), this);
143143
// Re-attach truffle stacktrace
144-
pe.initCause(e.getCause());
145-
// Host exceptions have their stacktrace already filled in, call this to set
146-
// the cutoff point to the catch site
147-
pe.getTruffleStackTrace();
144+
moveTruffleStacktTrace(e, pe);
148145
boolean handled = catchException(frame, pe);
149146
if (handled) {
150147
return;
@@ -157,6 +154,14 @@ public void executeVoid(VirtualFrame frame) {
157154
orelse.executeVoid(frame);
158155
}
159156

157+
@TruffleBoundary
158+
private static void moveTruffleStacktTrace(Throwable e, PException pe) {
159+
pe.initCause(e.getCause());
160+
// Host exceptions have their stacktrace already filled in, call this to set
161+
// the cutoff point to the catch site
162+
pe.getTruffleStackTrace();
163+
}
164+
160165
@TruffleBoundary
161166
private PBaseException getBaseException(Throwable e) {
162167
return factory().createBaseException(PythonErrorType.ValueError, "%m", new Object[]{e});

0 commit comments

Comments
 (0)