]> git.ipfire.org Git - thirdparty/mkosi.git/commitdiff
use os.fspath instead of str to stringify run arguments
authorJoerg Behrmann <behrmann@physik.fu-berlin.de>
Fri, 30 Sep 2022 09:51:49 +0000 (11:51 +0200)
committerJoerg Behrmann <behrmann@physik.fu-berlin.de>
Fri, 30 Sep 2022 09:51:49 +0000 (11:51 +0200)
str and bytes pass through it as is, but things supporting the __fspath__
protocol, like pathlib.Path, will use that.

mkosi/backend.py

index ab1b504ad99d2e3954e9fe1be213dee28fd2e463..ee75034263b11c478807df56046b665d72c1061b 100644 (file)
@@ -833,7 +833,7 @@ def run(
     env: Mapping[str, Any] = {},
     **kwargs: Any,
 ) -> CompletedProcess:
-    cmdline = [str(x) for x in cmdline]
+    cmdline = [os.fspath(x) for x in cmdline]
 
     if "run" in ARG_DEBUG:
         MkosiPrinter.info(f"+ {shell_join(cmdline)}")