Commit 2588b417 by serfrape

Allow to receive messages with lists of lists.

parent 51937a71
...@@ -221,15 +221,14 @@ def parse_literal(msg): ...@@ -221,15 +221,14 @@ def parse_literal(msg):
args = msg.split("(")[1] args = msg.split("(")[1]
args = args.split(")")[0] args = args.split(")")[0]
args = literal_eval(args) args = literal_eval(args)
if not isinstance(args, tuple):
args = (args,) def recursion(arg):
new_args = []
for arg in args:
if isinstance(arg, list): if isinstance(arg, list):
arg = tuple(arg) return tuple(recursion(i) for i in arg)
new_args.append(arg) return arg
args = tuple(new_args)
new_args = (recursion(args),)
else: else:
args = '' new_args = ''
return functor, args return functor, new_args
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment