Skip to content

Commit 223c895

Browse files
committed
[OMCSession] move call to set_timeout() to __post_init__
1 parent cbb6e56 commit 223c895

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

OMPython/OMCSession.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -677,9 +677,7 @@ def __init__(
677677
"""
678678

679679
# store variables
680-
# set_timeout() is used to define the value of _timeout as it includes additional checks
681-
self._timeout: float
682-
self.set_timeout(timeout=timeout)
680+
self._timeout = timeout
683681
# generate a random string for this instance of OMC
684682
self._random_string = uuid.uuid4().hex
685683
# get a temporary directory
@@ -713,6 +711,9 @@ def __post_init__(self) -> None:
713711
"""
714712
Create the connection to the OMC server using ZeroMQ.
715713
"""
714+
# set_timeout() is used to define the value of _timeout as it includes additional checks
715+
self.set_timeout(timeout=self._timeout)
716+
716717
port = self.get_port()
717718
if not isinstance(port, str):
718719
raise OMCSessionException(f"Invalid content for port: {port}")

0 commit comments

Comments
 (0)