Skip to content

Commit ef9fb4b

Browse files
committed
Fix formatting syntax errors from synthetic AST
1 parent 779dcfd commit ef9fb4b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/compiler/RaisePythonExceptionErrorCallback.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ public SourceSection getSourceSection() {
175175
// Not very nice. This counts on the implementation in traceback.py where if the value of
176176
// text attribute is NONE, then the line is not printed
177177
Object text = PNone.NONE;
178-
if (sourceRange.startLine <= source.getLineCount()) {
178+
if (source.hasCharacters() && sourceRange.startLine <= source.getLineCount()) {
179179
text = toTruffleStringUncached(source.getCharacters(sourceRange.startLine).toString());
180180
}
181181
excAttrs[SyntaxErrorBuiltins.IDX_MSG] = message;

0 commit comments

Comments
 (0)