From: Zbigniew Jędrzejewski-Szmek Date: Sun, 16 Jun 2024 12:08:13 +0000 (+0200) Subject: Two small cleanups suggests by pylint X-Git-Tag: v24~82^2 X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F2789%2Fhead;p=thirdparty%2Fmkosi.git Two small cleanups suggests by pylint --- diff --git a/mkosi/__init__.py b/mkosi/__init__.py index 8545ed095..fc1509529 100644 --- a/mkosi/__init__.py +++ b/mkosi/__init__.py @@ -1904,9 +1904,9 @@ def identify_cpu(root: Path) -> tuple[Optional[Path], Optional[Path]]: return (Path(f"{vendor_id}.bin"), ucode) elif vendor_id == "GenuineIntel": uroot = root / "usr/lib/firmware/intel-ucode" - if (ucode := (uroot / f"{family:02x}-{model:02x}-{stepping:02x}")).exists(): + if (ucode := uroot / f"{family:02x}-{model:02x}-{stepping:02x}").exists(): return (Path(f"{vendor_id}.bin"), ucode) - if (ucode := (uroot / f"{family:02x}-{model:02x}-{stepping:02x}.initramfs")).exists(): + if (ucode := uroot / f"{family:02x}-{model:02x}-{stepping:02x}.initramfs").exists(): return (Path(f"{vendor_id}.bin"), ucode) return (Path(f"{vendor_id}.bin"), None) diff --git a/mkosi/distributions/opensuse.py b/mkosi/distributions/opensuse.py index bcb02b570..14a64b2ce 100644 --- a/mkosi/distributions/opensuse.py +++ b/mkosi/distributions/opensuse.py @@ -1,9 +1,9 @@ # SPDX-License-Identifier: LGPL-2.1+ import tempfile -import xml.etree.ElementTree as ElementTree from collections.abc import Iterable, Sequence from pathlib import Path +from xml.etree import ElementTree from mkosi.config import Architecture, Config from mkosi.context import Context