Skip to content

Commit

Permalink
Fix method to detect Python
Browse files Browse the repository at this point in the history
  • Loading branch information
julianmendez committed Dec 28, 2023
1 parent 9cac115 commit a767210
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -88,18 +88,18 @@ public ProblogProcessor() {
}

boolean isPythonInstalled() {
boolean ret = false;
try {
ProcessBuilder builder = new ProcessBuilder(PYTHON_COMMAND, PYTHON_VERSION_OPTION);
Process process = builder.start();
process.waitFor();
BufferedReader reader = new BufferedReader(new InputStreamReader(process.getErrorStream()));
BufferedReader reader = new BufferedReader(new InputStreamReader(process.getInputStream()));
String line = reader.readLine();
return (line != null && line.startsWith(PYTHON_VERSION_3));
ret = (line != null && line.startsWith(PYTHON_VERSION_3));
} catch (IOException e) {
throw new UncheckedIOException(e);
} catch (InterruptedException e) {
throw new RuntimeException(e);
}
return ret;
}

String flattenArguments(String[] args) {
Expand Down

0 comments on commit a767210

Please sign in to comment.