@@ -323,7 +323,7 @@ def __init__(self, readonly=False, timeout=10.00,
323323 self ._serverIPAddress = "127.0.0.1"
324324 self ._interactivePort = None
325325 # FIXME: this code is not well written... need to be refactored
326- self ._temp_dir = tempfile .gettempdir ()
326+ self ._temp_dir = pathlib . Path ( tempfile .gettempdir () )
327327 # generate a random string for this session
328328 self ._random_string = uuid .uuid4 ().hex
329329 # omc log file
@@ -348,7 +348,7 @@ def __init__(self, readonly=False, timeout=10.00,
348348 self ._dockerNetwork = dockerNetwork
349349 self ._create_omc_log_file ("port" )
350350 self ._timeout = timeout
351- self ._port_file = os . path . join ("/tmp" if docker else self ._temp_dir , self ._port_file ).replace ( " \\ " , "/" )
351+ self ._port_file = (( pathlib . Path ("/tmp" ) if docker else self ._temp_dir ) / self ._port_file ).as_posix ( )
352352 self ._interactivePort = port
353353 # set omc executable path and args
354354 self ._set_omc_command ([
@@ -381,7 +381,7 @@ def _create_omc_log_file(self, suffix):
381381 else :
382382 log_filename = f"openmodelica.{ self ._currentUser } .{ suffix } .{ self ._random_string } .log"
383383 # this file must be closed in the destructor
384- self ._omc_log_file = open (pathlib . Path ( self ._temp_dir ) / log_filename , "w+" )
384+ self ._omc_log_file = open (self ._temp_dir / log_filename , "w+" )
385385
386386 def _start_omc_process (self , timeout ):
387387 if sys .platform == 'win32' :
0 commit comments