Skip to content

Commit 4e11eda

Browse files
committed
handle potential invalid path when using the launcher from java without and executable set
(cherry picked from commit 3697bec)
1 parent 52c75b7 commit 4e11eda

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

graalpython/com.oracle.graal.python.shell/src/com/oracle/graal/python/shell/GraalPythonMain.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
import java.io.OutputStream;
3737
import java.lang.management.ManagementFactory;
3838
import java.nio.file.Files;
39+
import java.nio.file.InvalidPathException;
3940
import java.nio.file.NoSuchFileException;
4041
import java.nio.file.Path;
4142
import java.nio.file.Paths;
@@ -753,7 +754,12 @@ private static String toAbsolutePath(String executable) {
753754
}
754755

755756
private void findAndApplyVenvCfg(Builder contextBuilder, String executable) {
756-
Path binDir = Paths.get(executable).getParent();
757+
Path binDir;
758+
try {
759+
binDir = Paths.get(executable).getParent();
760+
} catch (InvalidPathException e) {
761+
return;
762+
}
757763
if (binDir == null) {
758764
return;
759765
}

0 commit comments

Comments
 (0)