Skip to content

Commit cd00711

Browse files
committed
boot-qemu.py: Use re.MULTILINE instead of re.M
As suggested by the refurb rules from ruff: FURB167 [*] Use of regular expression alias `re.M` --> boot-qemu.py:140:93 | 138 | strings_stdout = strings.stdout.decode(encoding='utf-8', errors='ignore') 139 | 140 | if not (match := re.search(r'^Linux version (\d+\.\d+\.\d+)', strings_stdout, flags=re.M)): | ^^^^ 141 | raise RuntimeError(f"Could not find Linux version in {self.kernel}?") | help: Replace with `re.MULTILINE` Signed-off-by: Nathan Chancellor <nathan@kernel.org>
1 parent ae3982a commit cd00711

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

boot-qemu.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,11 @@ def _get_kernel_ver_tuple(self, decomp_prog: str) -> tuple[int, ...]:
136136
strings = subprocess.run('strings', capture_output=True, check=True, input=decomp.stdout)
137137
strings_stdout = strings.stdout.decode(encoding='utf-8', errors='ignore')
138138

139-
if not (match := re.search(r'^Linux version (\d+\.\d+\.\d+)', strings_stdout, flags=re.M)):
139+
if not (
140+
match := re.search(
141+
r'^Linux version (\d+\.\d+\.\d+)', strings_stdout, flags=re.MULTILINE
142+
)
143+
):
140144
raise RuntimeError(f"Could not find Linux version in {self.kernel}?")
141145

142146
return tuple(int(x) for x in match.groups()[0].split('.'))

0 commit comments

Comments
 (0)