Github user srowen commented on a diff in the pull request: https://github.com/apache/spark/pull/9111#discussion_r42230708 --- Diff: dev/run-tests.py --- @@ -176,17 +176,14 @@ def determine_java_version(java_exe): # find raw version string, eg 'java version "1.8.0_25"' raw_version_str = next(x for x in raw_output_lines if " version " in x) - version_str = raw_version_str.split()[-1].strip('"') # eg '1.8.0_25' - version, update = version_str.split('_') # eg ['1.8.0', '25'] + match = re.search('(\d+)\.(\d+)\.(\d+)_(\d+)', raw_version_str) - # map over the values and convert them to integers - version_info = [int(x) for x in version.split('.') + [update]] - - return JavaVersion(major=version_info[0], - minor=version_info[1], - patch=version_info[2], - update=version_info[3]) + major = int(match.group(1)) + minor = int(match.group(2)) + patch = int(match.group(3)) + update = int(match.group(4)) --- End diff -- LGTM. I suppose this assumes there's an "update" component but so did the previous implementation.
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. --- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org