File tree Expand file tree Collapse file tree 2 files changed +7
-4
lines changed
graalpython/com.oracle.graal.python/src/com/oracle/graal/python Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change 71
71
import com .oracle .graal .python .runtime .PythonContext ;
72
72
import com .oracle .graal .python .runtime .PythonCore ;
73
73
import com .oracle .graal .python .runtime .PythonOptions ;
74
+ import com .oracle .graal .python .runtime .exception .ExceptionUtils ;
74
75
import com .oracle .graal .python .runtime .exception .PException ;
75
76
import com .oracle .graal .python .runtime .exception .PythonExitException ;
76
77
import com .oracle .graal .python .runtime .object .PythonObjectFactory ;
@@ -136,10 +137,12 @@ public Object execute(VirtualFrame frame) {
136
137
}
137
138
return null ;
138
139
} catch (Exception | StackOverflowError e ) {
139
- if ( PythonOptions . getOption ( context . get (), PythonOptions . WithJavaStacktrace )) {
140
- boolean exitException = e instanceof TruffleException && (( TruffleException ) e ). isExit ();
141
- if (! exitException ) {
140
+ boolean exitException = e instanceof TruffleException && (( TruffleException ) e ). isExit ();
141
+ if (! exitException ) {
142
+ if (PythonOptions . getOption ( context . get (), PythonOptions . WithJavaStacktrace ) ) {
142
143
printStackTrace (e );
144
+ } else {
145
+ ExceptionUtils .printPythonLikeStackTrace (e );
143
146
}
144
147
}
145
148
throw e ;
Original file line number Diff line number Diff line change @@ -55,7 +55,7 @@ private ExceptionUtils() {
55
55
}
56
56
57
57
@ TruffleBoundary
58
- public static void printPythonLikeStackTrace (PException e ) {
58
+ public static void printPythonLikeStackTrace (Throwable e ) {
59
59
List <TruffleStackTraceElement > stackTrace = TruffleStackTrace .getStackTrace (e );
60
60
ArrayList <String > stack = new ArrayList <>();
61
61
for (TruffleStackTraceElement frame : stackTrace ) {
You can’t perform that action at this time.
0 commit comments