]> git.ipfire.org Git - thirdparty/mkosi.git/commitdiff
Do not use return in finally
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Fri, 20 Jun 2025 13:54:34 +0000 (15:54 +0200)
committerJörg Behrmann <behrmann@physik.fu-berlin.de>
Sat, 21 Jun 2025 08:13:58 +0000 (10:13 +0200)
This triggers a syntax warning on recent versions of python.

mkosi/run.py

index e6eac7b65e17835f9cb11c3babf6796d941aa6f7..cd1a25ae22baa2ebd6e532b1fa40016cb4329fd2 100644 (file)
@@ -453,11 +453,10 @@ def vartmpdir() -> Iterator[Path]:
                     shutil.rmtree(d)
 
                 fork_and_wait(remove)
-                return
             elif e.errno != errno.ENOENT:
                 raise
-
-        shutil.rmtree(d)
+        else:
+            shutil.rmtree(d)
 
 
 @contextlib.contextmanager