robertwb commented on code in PR #17366:
URL: https://github.com/apache/beam/pull/17366#discussion_r850718537


##########
sdks/java/extensions/python/src/main/java/org/apache/beam/sdk/extensions/python/PythonService.java:
##########
@@ -96,6 +95,18 @@ public AutoCloseable start() throws IOException, 
InterruptedException {
     return p::destroy;
   }
 
+  private String whichPython() {
+    for (String executable : ImmutableList.of("python3", "python")) {
+      try {
+        new ProcessBuilder(executable, "--version").start().waitFor();
+        return executable;
+      } catch (IOException | InterruptedException exn) {
+        // Ignore.

Review Comment:
   It will move on to the next item in the list above, trying to find some 
python in the path. In this case, first we're trying python3, and if that fails 
we try plain old python, and if that fails we give up (though we could add 
other items in this list as needed). 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to