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() {
581581 instance = PythonObjectFactory .getUncached ().createBaseException (cls , message , PythonUtils .EMPTY_OBJECT_ARRAY );
582582 final Object [] excAttrs = SyntaxErrorBuiltins .SYNTAX_ERROR_ATTR_FACTORY .create ();
583583 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>" ) ;
586586 excAttrs [SyntaxErrorBuiltins .IDX_LINENO ] = section .getStartLine ();
587587 excAttrs [SyntaxErrorBuiltins .IDX_OFFSET ] = section .getStartColumn ();
588588 // Not very nice. This counts on the implementation in traceback.py where if the value of
589589 // 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 ;
591591 excAttrs [SyntaxErrorBuiltins .IDX_MSG ] = message ;
592592 excAttrs [SyntaxErrorBuiltins .IDX_TEXT ] = text ;
593593 instance .setExceptionAttributes (excAttrs );
You can’t perform that action at this time.
0 commit comments