@@ -123,7 +123,9 @@ def _run_launch_server_process(ansys_path, ip, port, docker_name):
123123 if not bShell :
124124 process = subprocess .Popen (run_cmd , stdout = subprocess .PIPE , stderr = subprocess .PIPE )
125125 else :
126- process = subprocess .Popen (run_cmd , stdout = subprocess .PIPE , stderr = subprocess .PIPE , shell = True )
126+ process = subprocess .Popen (
127+ run_cmd , stdout = subprocess .PIPE , stderr = subprocess .PIPE , shell = True
128+ )
127129 os .chdir (old_dir )
128130 return process
129131
@@ -154,13 +156,13 @@ def launch_dpf(ansys_path, ip=LOCALHOST, port=DPF_DEFAULT_PORT, timeout=10, dock
154156 process : subprocess.Popen
155157 DPF Process.
156158 """
157- from ansys .dpf .core .server import port_in_use
158-
159159 process = _run_launch_server_process (ansys_path , ip , port , docker_name )
160160
161161 if docker_name is not None and os .name == 'posix' :
162162 run_cmd = "docker ps --all"
163- process = subprocess .Popen (run_cmd , stdout = subprocess .PIPE , stderr = subprocess .PIPE , shell = True )
163+ process = subprocess .Popen (
164+ run_cmd , stdout = subprocess .PIPE , stderr = subprocess .PIPE , shell = True
165+ )
164166 used_ports = []
165167 for line in io .TextIOWrapper (process .stdout , encoding = "utf-8" ):
166168 if not ("CONTAINER ID" in line ):
@@ -653,7 +655,7 @@ def __init__(self,
653655 data_processing_core_load_api (path , "common" )
654656 except Exception as e :
655657 if not os .path .isdir (os .path .dirname (path )):
656- raise NotADirectoryError (
658+ raise NotADirectoryError (
657659 f"DPF directory not found at { os .path .dirname (path )} "
658660 f"Unable to locate the following file: { path } " )
659661 raise e
@@ -872,26 +874,34 @@ def local_server(self):
872874
873875 def shutdown (self ):
874876 if self ._own_process and self .live :
875- bShell = False
877+ b_shell = False
876878 if os .name == 'posix' :
877- bShell = True
879+ b_shell = True
878880 try :
879881 self ._preparing_shutdown_func [0 ](self ._preparing_shutdown_func [1 ])
880882 except Exception as e :
881883 warnings .warn ("couldn't prepare shutdown: " + str (e .args ))
882884 if self .on_docker :
883885 run_cmd = f"docker stop { self ._server_id } "
884- if bShell :
885- process = subprocess .Popen (run_cmd , stdout = subprocess .PIPE , stderr = subprocess .PIPE , shell = True )
886+ if b_shell :
887+ process = subprocess .Popen (
888+ run_cmd , stdout = subprocess .PIPE , stderr = subprocess .PIPE , shell = True
889+ )
886890 else :
887- process = subprocess .Popen (run_cmd , stdout = subprocess .PIPE , stderr = subprocess .PIPE )
891+ process = subprocess .Popen (
892+ run_cmd , stdout = subprocess .PIPE , stderr = subprocess .PIPE
893+ )
888894 run_cmd = f"docker rm { self ._server_id } "
889- for line in io .TextIOWrapper (process .stdout , encoding = "utf-8" ):
895+ for _ in io .TextIOWrapper (process .stdout , encoding = "utf-8" ):
890896 pass
891- if bShell :
892- process = subprocess .Popen (run_cmd , stdout = subprocess .PIPE , stderr = subprocess .PIPE , shell = True )
897+ if b_shell :
898+ _ = subprocess .Popen (
899+ run_cmd , stdout = subprocess .PIPE , stderr = subprocess .PIPE , shell = True
900+ )
893901 else :
894- process = subprocess .Popen (run_cmd , stdout = subprocess .PIPE , stderr = subprocess .PIPE )
902+ _ = subprocess .Popen (
903+ run_cmd , stdout = subprocess .PIPE , stderr = subprocess .PIPE
904+ )
895905 elif self ._remote_instance :
896906 self ._remote_instance .delete ()
897907 else :
0 commit comments