]> git.ipfire.org Git - thirdparty/mkosi.git/commitdiff
Fix typing due to recent changes in typeshed
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Wed, 9 Apr 2025 07:56:52 +0000 (09:56 +0200)
committerJörg Behrmann <behrmann@physik.fu-berlin.de>
Wed, 9 Apr 2025 08:33:39 +0000 (10:33 +0200)
https://github.com/python/typeshed/pull/13767 narrows the typing for
shutil.copy2() so let's address that by fixing our typing.

mkosi/__init__.py

index 9a7650848cdfe8908385fe67806935f6654734ed..dd4ca8de45c0beb420fdf4d0fa3f0f49e00188d1 100644 (file)
@@ -3304,7 +3304,7 @@ def save_esp_components(
         if not stub.exists():
             die(f"sd-stub not found at /{stub.relative_to(context.root)} in the image")
 
-        return shutil.copy2(stub, context.workspace), None, None, []
+        return Path(shutil.copy2(stub, context.workspace)), None, None, []
 
     if context.config.output_format not in (OutputFormat.uki, OutputFormat.esp):
         return None, None, None, []
@@ -3317,7 +3317,7 @@ def save_esp_components(
 
         return None, None, None, []
 
-    kimg = shutil.copy2(context.root / kimg, context.workspace)
+    kimg = Path(shutil.copy2(context.root / kimg, context.workspace))
 
     if not context.config.architecture.to_efi():
         die(f"Architecture {context.config.architecture} does not support UEFI")
@@ -3326,7 +3326,7 @@ def save_esp_components(
     if not stub.exists():
         die(f"sd-stub not found at /{stub.relative_to(context.root)} in the image")
 
-    stub = shutil.copy2(stub, context.workspace)
+    stub = Path(shutil.copy2(stub, context.workspace))
     microcode = build_microcode_initrd(context)
 
     return stub, kver, kimg, microcode