Skip to content

Commit b31ded4

Browse files
committed
Refactor server_types.py/_get_dll_path to actually use core.misc.get_ansys_path and ensure the logic is the same
1 parent 1b0ec32 commit b31ded4

File tree

1 file changed

+1
-12
lines changed

1 file changed

+1
-12
lines changed

src/ansys/dpf/core/server_types.py

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
server_to_ansys_grpc_dpf_version,
2525
server_to_ansys_version,
2626
)
27-
from ansys.dpf.core.misc import __ansys_version__
2827
from ansys.dpf.core import server_context
2928
from ansys.dpf.gate import load_api, data_processing_grpcapi
3029

@@ -42,17 +41,7 @@
4241
def _get_dll_path(name, ansys_path=None):
4342
"""Helper function to get the right dll path for Linux or Windows"""
4443
ISPOSIX = os.name == "posix"
45-
if ansys_path is None:
46-
ansys_path = os.environ.get("ANSYS_DPF_PATH")
47-
if ansys_path is None:
48-
awp_root = "AWP_ROOT" + str(__ansys_version__)
49-
ANSYS_INSTALL = os.environ.get(awp_root, None)
50-
if ANSYS_INSTALL is None:
51-
ANSYS_INSTALL = core.misc.find_ansys()
52-
else:
53-
ANSYS_INSTALL = ansys_path
54-
if ANSYS_INSTALL is None:
55-
raise ImportError(f"Could not find ansys installation path using {awp_root}.")
44+
ANSYS_INSTALL = core.misc.get_ansys_path(ansys_path)
5645
api_path = load_api._get_path_in_install()
5746
if api_path is None:
5847
raise ImportError(f"Could not find API path in install.")

0 commit comments

Comments
 (0)