Skip to content

Commit 45fedae

Browse files
committed
Add timeout to call options
1 parent 227295d commit 45fedae

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

scscp/cli.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ def __init__(self, name, cd, cli):
1919
self.cd = cd
2020
self._cli = cli
2121
self._om = om.OMSymbol(name, cd=cd)
22-
def __call__(self, data, cookie=False, **opts):
22+
def __call__(self, data, cookie=False, timeout=-1, **opts):
2323
res = self._cli._call_wait(om.OMApplication(self._om, map(_conv_if_py, data)),
24-
cookie, **opts)
24+
cookie, timeout=timeout, **opts)
2525
if res.type == 'procedure_completed':
2626
try:
2727
return convert.to_python(res.data)
@@ -76,9 +76,9 @@ def __init__(self, host, port=26133, populate=True):
7676
if populate:
7777
self.populate_heads()
7878

79-
def _call_wait(self, data, cookie=False, **opts):
79+
def _call_wait(self, data, cookie=False, timeout=-1, **opts):
8080
call = self.call(data, cookie, **opts)
81-
resp = self.wait()
81+
resp = self.wait(timeout)
8282

8383
if resp.id != call.id:
8484
raise scscp.SCSCPProtocolError("Wrong call id (expected %s, got %s)."

0 commit comments

Comments
 (0)