Skip to content

Commit 5f461b0

Browse files
committed
fix relative import tests
1 parent 0ffda7f commit 5f461b0

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/nodes/statement/AbstractImportNode.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -433,7 +433,7 @@ String resolveName(VirtualFrame frame, String name, Object globals, int level,
433433
}
434434

435435
for (int levelUp = 1; levelUp < level; levelUp += 1) {
436-
lastDotIdx = pkgString.lastIndexOf('.', lastDotIdx);
436+
lastDotIdx = pkgString.lastIndexOf('.', lastDotIdx - 1);
437437
if (lastDotIdx == -1) {
438438
throw PConstructAndRaiseNode.getUncached().raiseImportError(frame, "attempted relative import beyond top-level package");
439439
}

0 commit comments

Comments
 (0)