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
1 changed files with 3 additions and 1 deletions

View File

@ -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)