[libvirt PATCH 1/3] scripts: Port meson-install-web.py to pathlib

Andrea Bolognani abologna at redhat.com
Tue Jul 19 14:17:43 UTC 2022


This will be useful later.

Signed-off-by: Andrea Bolognani <abologna at redhat.com>
---
 scripts/meson-install-web.py | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/scripts/meson-install-web.py b/scripts/meson-install-web.py
index a03f8523cd..fdf407ba33 100755
--- a/scripts/meson-install-web.py
+++ b/scripts/meson-install-web.py
@@ -4,7 +4,12 @@ import os
 import shutil
 import sys
 
+from pathlib import Path
+
 for desc in sys.argv[1:]:
     inst = desc.split(':')
-    os.makedirs(inst[1], exist_ok=True)
-    shutil.copy(inst[0], inst[1])
+    src = Path(inst[0])
+    dst = Path(inst[1])
+
+    dst.mkdir(parents=True, exist_ok=True)
+    shutil.copy(src, dst)
-- 
2.35.3



More information about the libvir-list mailing list