Refactor wk.clone.ddrescue.get_object()

This commit is contained in:
2Shirt 2023-05-29 17:29:02 -07:00
parent 2cce572acf
commit f50ea711e6
Signed by: 2Shirt
GPG key ID: 152FAC923B0E132C

View file

@ -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()