File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
graalpython/com.oracle.graal.python/src/com/oracle/graal/python/runtime/exception Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change 47
47
import com .oracle .graal .python .builtins .objects .object .PythonObjectLibrary ;
48
48
import com .oracle .graal .python .builtins .objects .traceback .LazyTraceback ;
49
49
import com .oracle .graal .python .builtins .objects .traceback .PTraceback ;
50
+ import com .oracle .graal .python .nodes .classes .IsSubtypeNode ;
50
51
import com .oracle .graal .python .nodes .object .IsBuiltinClassProfile ;
51
52
import com .oracle .truffle .api .CallTarget ;
52
53
import com .oracle .truffle .api .CompilerAsserts ;
@@ -180,7 +181,12 @@ public int getStackTraceElementLimit() {
180
181
181
182
@ Override
182
183
public boolean isSyntaxError () {
183
- return pythonException != null && IsBuiltinClassProfile .profileClassSlowPath (PythonObjectLibrary .getUncached ().getLazyPythonClass (pythonException ), PythonBuiltinClassType .SyntaxError );
184
+ if (pythonException == null ) {
185
+ return false ;
186
+ }
187
+ Object clazz = PythonObjectLibrary .getUncached ().getLazyPythonClass (pythonException );
188
+ return IsBuiltinClassProfile .profileClassSlowPath (clazz , PythonBuiltinClassType .SyntaxError ) ||
189
+ IsSubtypeNode .getUncached ().execute (clazz , PythonBuiltinClassType .SyntaxError );
184
190
}
185
191
186
192
public void setIncompleteSource (boolean val ) {
You can’t perform that action at this time.
0 commit comments