From f50ea711e6035a583acb58b82305cabe08d43f3a Mon Sep 17 00:00:00 2001 From: 2Shirt <2xShirt@gmail.com> Date: Mon, 29 May 2023 17:29:02 -0700 Subject: [PATCH] Refactor wk.clone.ddrescue.get_object() --- scripts/wk/clone/ddrescue.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/wk/clone/ddrescue.py b/scripts/wk/clone/ddrescue.py index 34dd3e9d..a1178fe1 100644 --- a/scripts/wk/clone/ddrescue.py +++ b/scripts/wk/clone/ddrescue.py @@ -1686,14 +1686,14 @@ def get_fstype_macos(path) -> str: return fstype -def get_object(path) -> hw_disk.Disk | None | pathlib.Path: +def get_object(path) -> hw_disk.Disk | pathlib.Path: """Get object based on path, returns obj.""" # TODO: Refactor to avoid returning None obj = None # Bail early if not path: - return obj + raise FileNotFoundError(f'Path provided does not exist: {path}') # Check path path = pathlib.Path(path).resolve()