File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
graalpython/com.oracle.graal.python/src/com/oracle/graal/python Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -581,13 +581,13 @@ public SourceSection getSourceSection() {
581
581
instance = PythonObjectFactory .getUncached ().createBaseException (cls , message , PythonUtils .EMPTY_OBJECT_ARRAY );
582
582
final Object [] excAttrs = SyntaxErrorBuiltins .SYNTAX_ERROR_ATTR_FACTORY .create ();
583
583
SourceSection section = location .getSourceSection ();
584
- String path = source .getPath ();
585
- excAttrs [SyntaxErrorBuiltins .IDX_FILENAME ] = (path != null ) ? path : source .getName () != null ? source .getName () : "<string>" ;
584
+ TruffleString path = toTruffleStringUncached ( source .getPath () );
585
+ excAttrs [SyntaxErrorBuiltins .IDX_FILENAME ] = (path != null ) ? path : source .getName () != null ? toTruffleStringUncached ( source .getName ()) : tsLiteral ( "<string>" ) ;
586
586
excAttrs [SyntaxErrorBuiltins .IDX_LINENO ] = section .getStartLine ();
587
587
excAttrs [SyntaxErrorBuiltins .IDX_OFFSET ] = section .getStartColumn ();
588
588
// Not very nice. This counts on the implementation in traceback.py where if the value of
589
589
// text attribute is NONE, then the line is not printed
590
- final String text = section .isAvailable () ? source .getCharacters (section .getStartLine ()).toString () : null ;
590
+ final TruffleString text = section .isAvailable () ? toTruffleStringUncached ( source .getCharacters (section .getStartLine ()).toString () ) : null ;
591
591
excAttrs [SyntaxErrorBuiltins .IDX_MSG ] = message ;
592
592
excAttrs [SyntaxErrorBuiltins .IDX_TEXT ] = text ;
593
593
instance .setExceptionAttributes (excAttrs );
You can’t perform that action at this time.
0 commit comments