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 7171import com .oracle .graal .python .runtime .PythonContext ;
7272import com .oracle .graal .python .runtime .PythonCore ;
7373import com .oracle .graal .python .runtime .PythonOptions ;
74+ import com .oracle .graal .python .runtime .exception .ExceptionUtils ;
7475import com .oracle .graal .python .runtime .exception .PException ;
7576import com .oracle .graal .python .runtime .exception .PythonExitException ;
7677import com .oracle .graal .python .runtime .object .PythonObjectFactory ;
@@ -136,10 +137,12 @@ public Object execute(VirtualFrame frame) {
136137 }
137138 return null ;
138139 } 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 ) ) {
142143 printStackTrace (e );
144+ } else {
145+ ExceptionUtils .printPythonLikeStackTrace (e );
143146 }
144147 }
145148 throw e ;
Original file line number Diff line number Diff line change @@ -55,7 +55,7 @@ private ExceptionUtils() {
5555 }
5656
5757 @ TruffleBoundary
58- public static void printPythonLikeStackTrace (PException e ) {
58+ public static void printPythonLikeStackTrace (Throwable e ) {
5959 List <TruffleStackTraceElement > stackTrace = TruffleStackTrace .getStackTrace (e );
6060 ArrayList <String > stack = new ArrayList <>();
6161 for (TruffleStackTraceElement frame : stackTrace ) {
You can’t perform that action at this time.
0 commit comments