2
0
mirror of https://github.com/m-labs/artiq.git synced 2024-12-25 03:08:27 +08:00

coredevice.comm_generic: handle RPC default args correctly.

This commit is contained in:
whitequark 2015-12-29 02:54:34 +08:00
parent 0dd71946b9
commit 8fb6d4cdb4

View File

@ -341,12 +341,14 @@ class CommGeneric:
def _receive_rpc_args(self, object_map, defaults):
args = []
default_arg_num = 0
while True:
value = self._receive_rpc_value(object_map)
if value is self._rpc_sentinel:
return args
elif value is self._rpc_undefined:
args.append(defaults[len(args)])
args.append(defaults[default_arg_num])
default_arg_num += 1
else:
args.append(value)