mirror of
https://gitlab.postmarketos.org/postmarketOS/pmbootstrap.git
synced 2025-07-13 03:19:47 +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:
parent
6c4b4c4993
commit
3d04e011f9
1 changed files with 2 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue