Skip to content

Commit

Permalink
Simplified regular expressions (now tests cover detection of version …
Browse files Browse the repository at this point in the history
…numbers with only a major version).
  • Loading branch information
hiker committed Aug 7, 2024
1 parent 83a3045 commit becb483
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions source/fab/tools/compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 "
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit becb483

Please sign in to comment.