diff options
author | José Fonseca <jfonseca@vmware.com> | 2014-06-20 14:10:36 +0100 |
---|---|---|
committer | José Fonseca <jfonseca@vmware.com> | 2014-06-24 16:30:34 +0100 |
commit | a0a2044e3431cd16c1804d33bacaf414e62396a2 (patch) | |
tree | eb2345ccbcc32c4abbb4587c43c61e3139aa2d6b /scripts | |
parent | 9f580dbb64839281c74cb68b6872370d0756af20 (diff) |
cli/pickle: Pass across tuples/lists consistently.
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/unpickle.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/scripts/unpickle.py b/scripts/unpickle.py index a561bf69..0249e4b7 100755 --- a/scripts/unpickle.py +++ b/scripts/unpickle.py @@ -125,10 +125,12 @@ class Dumper(Visitor): return repr(obj) def visitTuple(self, obj): - return '[' + ', '.join(itertools.imap(self.visit, obj)) + ']' + return '(' + ', '.join(itertools.imap(self.visit, obj)) + ')' def visitList(self, obj): - return '(' + ', '.join(itertools.imap(self.visit, obj)) + ')' + if len(obj) == 1: + return '&' + self.visit(obj[0]) + return '{' + ', '.join(itertools.imap(self.visit, obj)) + '}' def visitByteArray(self, obj): return 'blob(%u)' % len(obj) |