File tree Expand file tree Collapse file tree 3 files changed +12
-11
lines changed Expand file tree Collapse file tree 3 files changed +12
-11
lines changed Original file line number Diff line number Diff line change 88import logging
99import os
1010import subprocess
11- import sys
1211import time
1312import io
1413
@@ -609,11 +608,7 @@ def get_server_type_from_config(
609608 ansys_path = os .environ .get ("AWP_ROOT" + str (__ansys_version__ ), None )
610609 if ansys_path is not None :
611610 sub_folders = os .path .join (ansys_path , _get_path_in_install ())
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
611+ os .environ ["PATH" ] += sub_folders
617612 return GrpcServer
618613 elif config .protocol == CommunicationProtocols .InProcess and not config .legacy :
619614 return InProcessServer
Original file line number Diff line number Diff line change 99import os
1010import socket
1111import subprocess
12+ import sys
1213import time
1314import warnings
1415import traceback
@@ -925,6 +926,15 @@ def __init__(
925926 self ._context = server_context .AvailableServerContexts .premium
926927 pass
927928 self .set_as_global (as_global = as_global )
929+ # Update the python os.environment
930+ if not os .name == "posix" :
931+ path_str = "%PATH%"
932+ else :
933+ path_str = "$PATH"
934+ new_path = subprocess .check_output (
935+ ["echo" , path_str ], shell = True
936+ ).decode (sys .stdout .encoding )
937+ os .environ ["PATH" ] = new_path
928938
929939 @property
930940 def version (self ):
Original file line number Diff line number Diff line change 11import os
2- import subprocess
3- import sys
4-
52import packaging .version
63import pkg_resources
74import importlib
@@ -246,8 +243,7 @@ def load_grpc_client(ansys_path=None):
246243 # on libcrypto and libssl
247244 previous_path = ""
248245 if not ISPOSIX and ANSYS_PATH is not None :
249- # previous_path = os.getenv("PATH", "")
250- previous_path = subprocess .check_output (["echo" , "%PATH%" ], shell = True ).decode (sys .stdout .encoding )
246+ previous_path = os .getenv ("PATH" , "" )
251247 os .environ ["PATH" ] = path + ";" + previous_path
252248
253249 grpc_client_api_path = os .path .join (path , name )
You can’t perform that action at this time.
0 commit comments