mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
Python 3 compatibility fix for running Java tests using run_tests.py (flutter/engine#27970)
(Note that LUCI is currently still running this script using Python 2)
This commit is contained in:
parent
6d12ad484a
commit
5126dfe55e
@ -321,6 +321,7 @@ def AssertExpectedJavaVersion():
|
||||
EXPECTED_VERSION = '1.8'
|
||||
# `java -version` is output to stderr. https://bugs.java.com/bugdatabase/view_bug.do?bug_id=4380614
|
||||
version_output = subprocess.check_output(['java', '-version'], stderr=subprocess.STDOUT)
|
||||
version_output = version_output.decode('utf-8')
|
||||
match = bool(re.compile('version "%s' % EXPECTED_VERSION).search(version_output))
|
||||
message = "JUnit tests need to be run with Java %s. Check the `java -version` on your PATH." % EXPECTED_VERSION
|
||||
assert match, message
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user