@@ -288,8 +288,6 @@ def __init__(self, timeout=10.00,
288288 self ._temp_dir = pathlib .Path (tempfile .gettempdir ())
289289 # generate a random string for this session
290290 self ._random_string = uuid .uuid4 ().hex
291- # omc log file
292- self ._omc_log_file = None
293291 try :
294292 self ._currentUser = getpass .getuser ()
295293 if not self ._currentUser :
@@ -308,7 +306,7 @@ def __init__(self, timeout=10.00,
308306 self ._dockerExtraArgs = dockerExtraArgs
309307 self ._dockerOpenModelicaPath = dockerOpenModelicaPath
310308 self ._dockerNetwork = dockerNetwork
311- self ._create_omc_log_file ("port" )
309+ self ._omc_log_file = self . _create_omc_log_file ("port" )
312310 self ._timeout = timeout
313311 self ._port_file = ((pathlib .Path ("/tmp" ) if docker else self ._temp_dir ) / self ._port_file ).as_posix ()
314312 self ._interactivePort = port
@@ -339,13 +337,15 @@ def __del__(self):
339337 self ._omc_process .kill ()
340338 self ._omc_process .wait ()
341339
342- def _create_omc_log_file (self , suffix ):
340+ def _create_omc_log_file (self , suffix ): # output?
343341 if sys .platform == 'win32' :
344342 log_filename = f"openmodelica.{ suffix } .{ self ._random_string } .log"
345343 else :
346344 log_filename = f"openmodelica.{ self ._currentUser } .{ suffix } .{ self ._random_string } .log"
347345 # this file must be closed in the destructor
348- self ._omc_log_file = open (self ._temp_dir / log_filename , "w+" )
346+ omc_log_file = open (self ._temp_dir / log_filename , "w+" )
347+
348+ return omc_log_file
349349
350350 def _start_omc_process (self , timeout ):
351351 if sys .platform == 'win32' :
0 commit comments