Skip to content

Commit cda3fc2

Browse files
committed
Fix 1
Signed-off-by: paul.profizi <[email protected]>
1 parent 98e465a commit cda3fc2

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

src/ansys/dpf/core/server_factory.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import logging
99
import os
1010
import subprocess
11+
import sys
1112
import time
1213
import io
1314

@@ -608,7 +609,11 @@ def get_server_type_from_config(
608609
ansys_path = os.environ.get("AWP_ROOT" + str(__ansys_version__), None)
609610
if ansys_path is not None:
610611
sub_folders = os.path.join(ansys_path, _get_path_in_install())
611-
os.environ["PATH"] += sub_folders
612+
if not os.name == "posix":
613+
previous_path = subprocess.check_output(["echo", "%PATH%"], shell=True).decode(sys.stdout.encoding)
614+
else:
615+
previous_path = os.environ["PATH"]
616+
os.environ["PATH"] = previous_path + sub_folders
612617
return GrpcServer
613618
elif config.protocol == CommunicationProtocols.InProcess and not config.legacy:
614619
return InProcessServer

src/ansys/dpf/gate/load_api.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
import os
2+
import subprocess
3+
import sys
4+
25
import packaging.version
36
import pkg_resources
47
import importlib
@@ -243,7 +246,8 @@ def load_grpc_client(ansys_path=None):
243246
# on libcrypto and libssl
244247
previous_path = ""
245248
if not ISPOSIX and ANSYS_PATH is not None:
246-
previous_path = os.getenv("PATH", "")
249+
# previous_path = os.getenv("PATH", "")
250+
previous_path = subprocess.check_output(["echo", "%PATH%"], shell=True).decode(sys.stdout.encoding)
247251
os.environ["PATH"] = path + ";" + previous_path
248252

249253
grpc_client_api_path = os.path.join(path, name)

0 commit comments

Comments
 (0)