From becb483e984aab8932866dc45aaa5ab86435d0b3 Mon Sep 17 00:00:00 2001 From: Joerg Henrichs Date: Wed, 7 Aug 2024 11:23:15 +1000 Subject: [PATCH] Simplified regular expressions (now tests cover detection of version numbers with only a major version). --- source/fab/tools/compiler.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/fab/tools/compiler.py b/source/fab/tools/compiler.py index 2e69e55a..614a4100 100644 --- a/source/fab/tools/compiler.py +++ b/source/fab/tools/compiler.py @@ -344,7 +344,7 @@ def parse_gnu_version_output( if category is Category.FORTRAN_COMPILER: display_name = 'GNU Fortran' - exp = display_name + r" \(.*?\) (\d[\d\.]+\d)\b" + exp = display_name + r" \(.*?\) ([\d\.]+)\b" matches = re.findall(exp, version_output) if not matches: raise RuntimeError(f"Unexpected version output format for " @@ -410,7 +410,7 @@ def parse_intel_version_output(name: str, version_output: str) -> str: # Expect the version to appear after some in parentheses, e.g. # "icc (...) n.n[.n, ...]" or "ifort (...) n.n[.n, ...]" - exp = name + r" \(.*?\) (\d[\d\.]+\d)\b" + exp = name + r" \(.*?\) ([\d\.]+)\b" matches = re.findall(exp, version_output) if not matches: