We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f77ee5d commit d60014dCopy full SHA for d60014d
graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/code/CodeBuiltins.java
@@ -103,7 +103,12 @@ public abstract static class LinenoNode extends PythonBuiltinNode {
103
@TruffleBoundary
104
protected Object doIt(PythonParseResult self) {
105
RootNode rootNode = self.getRootNode();
106
- return rootNode.getSourceSection().getStartLine();
+ SourceSection sourceSection = rootNode.getSourceSection();
107
+ if (sourceSection == null) {
108
+ return 1;
109
+ } else {
110
+ return sourceSection.getStartLine();
111
+ }
112
}
113
114
0 commit comments