From acfcef368362194ae7db7eff88d0ba9c9602e808 Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Fri, 15 Dec 2023 16:40:05 +0200 Subject: [PATCH] aedi: make mypy linter happy state.py:112: error: Item "None" of "Match[str] | None" has no attribute "group" [union-attr] --- aedi/state.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/aedi/state.py b/aedi/state.py index 209bc3f6..52476690 100644 --- a/aedi/state.py +++ b/aedi/state.py @@ -109,10 +109,12 @@ class BuildState: version_output = subprocess.run(('clang', '--version'), check=True, capture_output=True) version_match = re.search(r'\(clang-([\d.]+)\)', version_output.stdout.decode('ascii')) - version = StrictVersion(version_match.group(1)) - if version.major == 1500 and version.minor == 0: - self._linker_flags += ' -Wl,-ld_classic' + if version_match: + version = StrictVersion(version_match.group(1)) + + if version.major == 1500 and version.minor == 0: + self._linker_flags += ' -Wl,-ld_classic' return self._linker_flags