1
0
Fork 1
mirror of https://gitlab.postmarketos.org/postmarketOS/pmbootstrap.git synced 2025-07-13 11:29:46 +03:00

config: use is instead of == (MR 2343)

make ruff happy

Signed-off-by: Caleb Connolly <caleb@postmarketos.org>
This commit is contained in:
Caleb Connolly 2024-07-02 13:33:23 +02:00
parent 6c4b4c4993
commit 3d04e011f9
No known key found for this signature in database
GPG key ID: 5AE7F5513E0885CB

View file

@ -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