diff --git a/rpc.py b/rpc.py index 8ff9ca7..6985f0b 100644 --- a/rpc.py +++ b/rpc.py @@ -32,7 +32,7 @@ def l_pack(value: Any, envelope: int=3, wrapped: bool=True, basictype=b'0', enco bare = b't'.join(l_pack(k, envelope=envelope, wrapped=False, encoding=encoding) + l_pack(v, envelope=envelope, wrapped=False, encoding=encoding) for k, v in value.items()) return (b'2' + bare + b'f') if wrapped else bare elif not isinstance(value, str) and hasattr(value, '__iter__'): - bare = b't'.join(l_pack(k, envelope=envelope, wrapped=False, encoding=encoding) + l_pack(v, envelope=envelope, wrapped=False, encoding=encoding) for k, v in enumerate(value)) + bare = b't'.join(l_pack(k, envelope=envelope, wrapped=False, encoding=encoding) + l_pack(v, envelope=envelope, wrapped=False, encoding=encoding) for k, v in enumerate(value, start=1)) return (b'2' + bare + b'f') if wrapped else bare elif isinstance(value, MReference): return l_pack(str(value), envelope=envelope, basictype=b'1', encoding=encoding)