Skip to content

Commit ac0061a

Browse files
committed
[OMCSession] move call to set_timeout() to __post_init__
1 parent 09f4cdc commit ac0061a

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

OMPython/OMCSession.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -648,9 +648,7 @@ def __init__(
648648
"""
649649

650650
# store variables
651-
# set_timeout() is used to define the value of _timeout as it includes additional checks
652-
self._timeout: float
653-
self.set_timeout(timeout=timeout)
651+
self._timeout = timeout
654652
# generate a random string for this instance of OMC
655653
self._random_string = uuid.uuid4().hex
656654
# get a temporary directory
@@ -684,6 +682,9 @@ def __post_init__(self) -> None:
684682
"""
685683
Create the connection to the OMC server using ZeroMQ.
686684
"""
685+
# set_timeout() is used to define the value of _timeout as it includes additional checks
686+
self.set_timeout(timeout=self._timeout)
687+
687688
port = self.get_port()
688689
if not isinstance(port, str):
689690
raise OMCSessionException(f"Invalid content for port: {port}")

0 commit comments

Comments
 (0)