summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorJosé Fonseca <jfonseca@vmware.com>2014-06-20 14:10:36 +0100
committerJosé Fonseca <jfonseca@vmware.com>2014-06-24 16:30:34 +0100
commita0a2044e3431cd16c1804d33bacaf414e62396a2 (patch)
treeeb2345ccbcc32c4abbb4587c43c61e3139aa2d6b /scripts
parent9f580dbb64839281c74cb68b6872370d0756af20 (diff)
cli/pickle: Pass across tuples/lists consistently.
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/unpickle.py6
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)