mirror of https://github.com/m-labs/artiq.git
coredevice.comm_generic: handle RPC default args correctly.
This commit is contained in:
parent
0dd71946b9
commit
8fb6d4cdb4
|
@ -341,12 +341,14 @@ class CommGeneric:
|
||||||
|
|
||||||
def _receive_rpc_args(self, object_map, defaults):
|
def _receive_rpc_args(self, object_map, defaults):
|
||||||
args = []
|
args = []
|
||||||
|
default_arg_num = 0
|
||||||
while True:
|
while True:
|
||||||
value = self._receive_rpc_value(object_map)
|
value = self._receive_rpc_value(object_map)
|
||||||
if value is self._rpc_sentinel:
|
if value is self._rpc_sentinel:
|
||||||
return args
|
return args
|
||||||
elif value is self._rpc_undefined:
|
elif value is self._rpc_undefined:
|
||||||
args.append(defaults[len(args)])
|
args.append(defaults[default_arg_num])
|
||||||
|
default_arg_num += 1
|
||||||
else:
|
else:
|
||||||
args.append(value)
|
args.append(value)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue