From 3d04e011f95dc2f559868a403923210f5b34e9c1 Mon Sep 17 00:00:00 2001 From: Caleb Connolly Date: Tue, 2 Jul 2024 13:33:23 +0200 Subject: [PATCH] config: use is instead of == (MR 2343) make ruff happy Signed-off-by: Caleb Connolly --- pmb/config/file.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pmb/config/file.py b/pmb/config/file.py index 0cad4bc0..00713c31 100644 --- a/pmb/config/file.py +++ b/pmb/config/file.py @@ -40,7 +40,7 @@ def load(path: Path) -> Config: logging.warning("Multiple mirrors are not supported, using the last one") config.mirrors["pmaports"] = mirrors[-1].strip("/master") # Convert strings to paths - elif type(getattr(Config, key)) == PosixPath: + elif type(getattr(Config, key)) is PosixPath: setattr(config, key, Path(cfg["pmbootstrap"][key])) # Yeah this really sucks and there isn't a better way to do it without external # libraries @@ -94,7 +94,7 @@ def serialize(config: Config, skip_defaults=True) -> configparser.ConfigParser: _key = key.split(".")[1] cfg["mirrors"][_key] = getattr(config, key) # Convert strings to paths - elif type(getattr(Config, key)) == PosixPath: + elif type(getattr(Config, key)) is PosixPath: cfg["pmbootstrap"][key] = str(getattr(config, key)) elif isinstance(getattr(Config, key), list) and isinstance( getattr(Config, key)[0], PosixPath