Skip to content

Commit

Permalink
[SPARK-12502][BUILD][PYTHON] Script /dev/run-tests fails when IBM Jav…
Browse files Browse the repository at this point in the history
…a is used

fix an exception with IBM JDK by removing update field from a JavaVersion tuple. This is because IBM JDK does not have information on update '_xx'

Author: Kazuaki Ishizaki <[email protected]>

Closes apache#10463 from kiszk/SPARK-12502.
  • Loading branch information
kiszk authored and sarutak committed Dec 24, 2015
1 parent ead6abf commit 9e85bb7
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions dev/run-tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ def determine_java_executable():
return java_exe if java_exe else which("java")


JavaVersion = namedtuple('JavaVersion', ['major', 'minor', 'patch', 'update'])
JavaVersion = namedtuple('JavaVersion', ['major', 'minor', 'patch'])


def determine_java_version(java_exe):
Expand All @@ -164,14 +164,13 @@ 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)

match = re.search('(\d+)\.(\d+)\.(\d+)_(\d+)', raw_version_str)
match = re.search('(\d+)\.(\d+)\.(\d+)', raw_version_str)

major = int(match.group(1))
minor = int(match.group(2))
patch = int(match.group(3))
update = int(match.group(4))

return JavaVersion(major, minor, patch, update)
return JavaVersion(major, minor, patch)

# -------------------------------------------------------------------------------------------------
# Functions for running the other build and test scripts
Expand Down

0 comments on commit 9e85bb7

Please sign in to comment.