@@ -296,7 +296,7 @@ def __init__(self, readonly=False, timeout=10.00,
296296 self ._serverIPAddress = "127.0.0.1"
297297 self ._interactivePort = None
298298 # FIXME: this code is not well written... need to be refactored
299- self ._temp_dir = tempfile .gettempdir ()
299+ self ._temp_dir = pathlib . Path ( tempfile .gettempdir () )
300300 # generate a random string for this session
301301 self ._random_string = uuid .uuid4 ().hex
302302 # omc log file
@@ -321,7 +321,7 @@ def __init__(self, readonly=False, timeout=10.00,
321321 self ._dockerNetwork = dockerNetwork
322322 self ._create_omc_log_file ("port" )
323323 self ._timeout = timeout
324- self ._port_file = os . path . join ("/tmp" if docker else self ._temp_dir , self ._port_file ).replace ( " \\ " , "/" )
324+ self ._port_file = (( pathlib . Path ("/tmp" ) if docker else self ._temp_dir ) / self ._port_file ).as_posix ( )
325325 self ._interactivePort = port
326326 # set omc executable path and args
327327 self ._set_omc_command ([
@@ -354,7 +354,7 @@ def _create_omc_log_file(self, suffix):
354354 else :
355355 log_filename = f"openmodelica.{ self ._currentUser } .{ suffix } .{ self ._random_string } .log"
356356 # this file must be closed in the destructor
357- self ._omc_log_file = open (pathlib . Path ( self ._temp_dir ) / log_filename , "w+" )
357+ self ._omc_log_file = open (self ._temp_dir / log_filename , "w+" )
358358
359359 def _start_omc_process (self , timeout ):
360360 if sys .platform == 'win32' :
0 commit comments