From 6435f6b8825c41f309a7820cc922f6abeded0e1c Mon Sep 17 00:00:00 2001 From: aikaterna <20862007+aikaterna@users.noreply.github.com> Date: Fri, 23 Nov 2018 15:45:37 -0800 Subject: [PATCH] [Audio] Match openJDK 11 on Ubuntu (#2270) Using the OpenJDK 11 from java.net on Ubuntu 18 reports "11" as the version, which failed the Java version check on loading audio on a new instance. This change will return "11 0" as the version, passing the check, instead of just "11". --- redbot/cogs/audio/manager.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/redbot/cogs/audio/manager.py b/redbot/cogs/audio/manager.py index 8cc988eff..df8649279 100644 --- a/redbot/cogs/audio/manager.py +++ b/redbot/cogs/audio/manager.py @@ -72,12 +72,16 @@ async def get_java_version(loop) -> _JavaVersion: # ... # We only care about the major and minor parts though. version_line_re = re.compile(r'version "(?P\d+).(?P\d+).\d+(?:_\d+)?"') + short_version_re = re.compile(r'version "(?P\d+)"') lines = version_info.splitlines() for line in lines: match = version_line_re.search(line) + short_match = short_version_re.search(line) if match: return int(match["major"]), int(match["minor"]) + elif short_match: + return int(short_match["major"]), 0 raise RuntimeError( "The output of `java -version` was unexpected. Please report this issue on Red's "