Skip to content

Commit d4f0b54

Browse files
committed
[GR-16720] [GH-78] Give full path for code objects.
PullRequest: graalpython/566
2 parents e129177 + 706b11e commit d4f0b54

File tree

1 file changed

+4
-1
lines changed
  • graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/code

1 file changed

+4
-1
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/code/PCode.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,10 @@ private static String extractFileName(RootNode rootNode) {
169169
RootNode funcRootNode = (rootNode instanceof GeneratorFunctionRootNode) ? ((GeneratorFunctionRootNode) rootNode).getFunctionRootNode() : rootNode;
170170
SourceSection src = funcRootNode.getSourceSection();
171171
if (src != null) {
172-
return src.getSource().getName();
172+
if (src.getSource().getPath() == null) {
173+
return src.getSource().getName();
174+
}
175+
return src.getSource().getPath();
173176
} else if (funcRootNode instanceof ModuleRootNode) {
174177
return funcRootNode.getName();
175178
} else {

0 commit comments

Comments
 (0)