diff --git a/src/main/java/org/apposed/appose/Environment.java b/src/main/java/org/apposed/appose/Environment.java index fa2e645..9fec5f0 100644 --- a/src/main/java/org/apposed/appose/Environment.java +++ b/src/main/java/org/apposed/appose/Environment.java @@ -57,7 +57,7 @@ public interface Environment { */ default Service python() throws IOException { List pythonExes = Arrays.asList( - "python", "python.exe", + "python", "python3", "python.exe", "bin/python", "bin/python.exe" ); return service(pythonExes, "-c", diff --git a/src/main/java/org/apposed/appose/FilePaths.java b/src/main/java/org/apposed/appose/FilePaths.java index 7e31e08..e347119 100644 --- a/src/main/java/org/apposed/appose/FilePaths.java +++ b/src/main/java/org/apposed/appose/FilePaths.java @@ -72,7 +72,7 @@ public static File findExe(List dirs, List exes) { // Candidate is a relative path; check beneath each given directory. for (String dir : dirs) { File f = Paths.get(dir, exe).toFile(); - if (f.canExecute()) return f; + if (f.canExecute() && !f.isDirectory()) return f; } } } diff --git a/src/test/java/org/apposed/appose/ApposeTest.java b/src/test/java/org/apposed/appose/ApposeTest.java index 5770cc4..0804b42 100644 --- a/src/test/java/org/apposed/appose/ApposeTest.java +++ b/src/test/java/org/apposed/appose/ApposeTest.java @@ -95,7 +95,7 @@ public void testServiceStartupFailure() throws IOException { catch (IllegalArgumentException exc) { assertEquals( "No executables found amongst candidates: " + - "[python, python.exe, bin/python, bin/python.exe]", + "[python, python3, python.exe, bin/python, bin/python.exe]", exc.getMessage() ); }