From deb709d488b367ac8038cb68def291a347a650f2 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Mon, 17 Jul 2023 23:07:42 +0200 Subject: [PATCH] wipe/run --- file/__init__.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/file/__init__.py b/file/__init__.py index f622b10..eaf0059 100644 --- a/file/__init__.py +++ b/file/__init__.py @@ -6,7 +6,7 @@ CHARSET = 'UTF-8' def create_image(file_path: str, size_bytes: int): - subprocess.call([ + subprocess.run([ 'qemu-img', 'create', '-f', 'qcow2', @@ -28,6 +28,8 @@ def wipe(path: str): shutil.rmtree(path) except NotADirectoryError: os.remove(path) + except FileNotFoundError: + pass def write(file_path: str, text: str, charset=CHARSET):