Commit 247d23dc authored by Jeremy Hylton's avatar Jeremy Hylton

Be more robust about unpacking errors.

Print repr of description instead of str.
parent 4e36c877
...@@ -56,7 +56,7 @@ def report(oid, data, serial, fs, missing): ...@@ -56,7 +56,7 @@ def report(oid, data, serial, fs, missing):
description = "%s.%s" % info description = "%s.%s" % info
else: else:
description = str(info) description = str(info)
print "\toid %s %s: %s" % (hex(u64(oid)), reason, description) print "\toid %s %s: %r" % (hex(u64(oid)), reason, description)
print print
def main(path): def main(path):
...@@ -80,7 +80,7 @@ def main(path): ...@@ -80,7 +80,7 @@ def main(path):
for info in refs: for info in refs:
try: try:
ref, klass = info ref, klass = info
except TypeError: except (ValueError, TypeError):
# failed to unpack # failed to unpack
ref = info ref = info
klass = '<unknown>' klass = '<unknown>'
......
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