Skip to content

Commit d30bf9a

Browse files
committed
[OMCSessionZMQ] simplify _port_file
1 parent 7c08a02 commit d30bf9a

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

OMPython/OMCSession.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -295,19 +295,19 @@ def __init__(self, timeout=10.00,
295295
# We are running as a uid not existing in the password database... Pretend we are nobody
296296
self._currentUser = "nobody"
297297

298-
# Locating and using the IOR
299-
if sys.platform != 'win32' or docker or dockerContainer:
300-
self._port_file = "openmodelica." + self._currentUser + ".port." + self._random_string
301-
else:
302-
self._port_file = "openmodelica.port." + self._random_string
303298
self._docker = docker
304299
self._dockerContainer = dockerContainer
305300
self._dockerExtraArgs = dockerExtraArgs
306301
self._dockerOpenModelicaPath = dockerOpenModelicaPath
307302
self._dockerNetwork = dockerNetwork
308303
self._omc_log_file = self._create_omc_log_file("port")
309304
self._timeout = timeout
310-
self._port_file = ((pathlib.Path("/tmp") if docker else self._temp_dir) / self._port_file).as_posix()
305+
# Locating and using the IOR
306+
if sys.platform != 'win32' or docker or dockerContainer:
307+
port_file = "openmodelica." + self._currentUser + ".port." + self._random_string
308+
else:
309+
port_file = "openmodelica.port." + self._random_string
310+
self._port_file = ((pathlib.Path("/tmp") if docker else self._temp_dir) / port_file).as_posix()
311311
self._interactivePort = port
312312
# set omc executable path and args
313313
self._set_omc_command(omc_path_and_args_list=["--interactive=zmq",

0 commit comments

Comments
 (0)