From f4e44b50526fe2559704da6559f981ea4404062b Mon Sep 17 00:00:00 2001 From: dkunhamb Date: Fri, 20 Dec 2024 10:51:30 -0800 Subject: [PATCH] update the error message --- src/ansys/tools/path/path.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/ansys/tools/path/path.py b/src/ansys/tools/path/path.py index 9dfd1ec..c33b8e4 100644 --- a/src/ansys/tools/path/path.py +++ b/src/ansys/tools/path/path.py @@ -1109,8 +1109,6 @@ def _mechanical_version_from_path(path: str) -> int: """ # expect v/ansys # replace \\ with / to account for possible windows path - if path is None: - raise Exception("Path is None") matches = re.findall(r"v(\d\d\d)", path.replace("\\", "/"), re.IGNORECASE) if not matches: raise RuntimeError(f"Unable to extract Mechanical version from {path}.") @@ -1159,9 +1157,9 @@ def version_from_path(product: PRODUCT_TYPE, path: str) -> int: """ if not isinstance(path, str): raise ValueError( - f"Provided path '{path}' is not valid string." - "Check if the {product} is installed in default location" - "If not use 'save-ansys-path' to save the path." + f"Provided path '{path}' is not valid string. " + "Check if the {product} is installed in default location. " + "If not use ``save-ansys-path`` to save the path." ) if product == "mechanical": return _mechanical_version_from_path(path)