Skip to content

Commit 19fed63

Browse files
committed
[OMCSessionCmd] restore test_ZMQ - move execute() back into OMCSessionZMQ
1 parent fd97b41 commit 19fed63

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

OMPython/OMCSession.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -90,12 +90,6 @@ def __init__(self, session: OMCSessionZMQ, readonly: Optional[bool] = False):
9090
self._readonly = readonly
9191
self._omc_cache = {}
9292

93-
def execute(self, command):
94-
warnings.warn("This function is depreciated and will be removed in future versions; "
95-
"please use sendExpression() instead", DeprecationWarning, stacklevel=1)
96-
97-
return self.sendExpression(command, parsed=False)
98-
9993
def _ask(self, question: str, opt: Optional[list[str]] = None, parsed: Optional[bool] = True):
10094

10195
if opt is None:
@@ -516,6 +510,12 @@ def _connect_to_omc(self, timeout):
516510
self._omc.setsockopt(zmq.IMMEDIATE, True) # Queue messages only to completed connections
517511
self._omc.connect(self._port)
518512

513+
def execute(self, command):
514+
warnings.warn("This function is depreciated and will be removed in future versions; "
515+
"please use sendExpression() instead", DeprecationWarning, stacklevel=1)
516+
517+
return self.sendExpression(command, parsed=False)
518+
519519
def sendExpression(self, command, parsed=True):
520520
p = self._omc_process.poll() # check if process is running
521521
if p is not None:

0 commit comments

Comments
 (0)