Skip to content

Commit 5b6195a

Browse files
committed
Combine output lines when checking version
Suggested by @gselzer to work around failure to detect Java version noted in https://forum.image.sc/t/pyimagej-on-windows-10/107934/11 when JAVA_TOOL_OPTIONS is set
1 parent b66fc06 commit 5b6195a

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/scyjava/_jvm.py

+1
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ def jvm_version() -> str:
9898
except subprocess.CalledProcessError as e:
9999
raise RuntimeError("System call to java failed") from e
100100

101+
output = output.replace('\n', ' ').replace('\r', '')
101102
m = re.match('.*version "(([0-9]+\\.)+[0-9]+)', output)
102103
if not m:
103104
raise RuntimeError(f"Inscrutable java command output:\n{output}")

0 commit comments

Comments
 (0)