]> git.ipfire.org Git - thirdparty/mkosi.git/commitdiff
Make sure args_find_path() works with as_list
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Tue, 24 Jan 2023 10:55:07 +0000 (11:55 +0100)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Tue, 24 Jan 2023 11:11:29 +0000 (12:11 +0100)
The default when using list arguments is [], so let's modify the
check to account for this.

mkosi/__init__.py

index 2e27b496c30ad042ecbd46521a3c970bf9121daf..12d9b759d06df58521b19ada4c00ae2ea7e36630 100644 (file)
@@ -2615,7 +2615,7 @@ def find_skeleton(args: argparse.Namespace) -> None:
 
 
 def args_find_path(args: argparse.Namespace, name: str, path: str, *, as_list: bool = False) -> None:
-    if getattr(args, name) is not None:
+    if getattr(args, name):
         return
     abspath = Path(path).absolute()
     if abspath.exists():