aboutsummaryrefslogtreecommitdiffstats
path: root/libbe/diff.py
diff options
context:
space:
mode:
authorW. Trevor King <wking@drexel.edu>2009-12-05 08:08:09 -0500
committerW. Trevor King <wking@drexel.edu>2009-12-05 08:08:09 -0500
commite260fa7ed1e501404c75cdbe3d7461f29cd6c3e1 (patch)
tree668ec82048e86a5ee3fa8826e5545d48dabcae0d /libbe/diff.py
parentcc58188259e36193c3174fbb55e37c790382a7ea (diff)
downloadbugseverywhere-e260fa7ed1e501404c75cdbe3d7461f29cd6c3e1.tar.gz
Adjust libbe.diff.DiffTree to fix failed doctest.
====================================================================== FAIL: Doctest: libbe.diff.DiffTree ---------------------------------------------------------------------- Traceback (most recent call last): File "/usr/lib/python2.5/doctest.py", line 2128, in runTest raise self.failureException(self.format_failure(new.getvalue())) AssertionError: Failed doctest test for libbe.diff.DiffTree File "/home/wking/src/fun/be/be.diff-subscribe/libbe/diff.py", line 136, in DiffTree ---------------------------------------------------------------------- File "/home/wking/src/fun/be/be.diff-subscribe/libbe/diff.py", line 172, in libbe.diff.DiffTree Failed example: print bugdir.report_string() Exception raised: Traceback (most recent call last): File "/usr/lib/python2.5/doctest.py", line 1228, in __run compileflags, 1) in test.globs File "<doctest libbe.diff.DiffTree[18]>", line 1, in <module> print bugdir.report_string() File "/home/wking/src/fun/be/be.diff-subscribe/libbe/diff.py", line 213, in report_string return "\n".join(self.report()) TypeError
Diffstat (limited to 'libbe/diff.py')
-rw-r--r--libbe/diff.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/libbe/diff.py b/libbe/diff.py
index 46b8bda..b3cd6bc 100644
--- a/libbe/diff.py
+++ b/libbe/diff.py
@@ -210,12 +210,15 @@ class DiffTree (tree.Tree):
raise KeyError, "%s doesn't match '%s'" % (names, self.name)
raise KeyError, "%s points to child not in %s" % (names, [c.name for c in self])
def report_string(self):
- return "\n".join(self.report())
+ report = self.report()
+ if report == None:
+ return ''
+ return '\n'.join(report)
def report(self, root=None, parent=None, depth=0):
if root == None:
root = self.make_root()
if self.masked == True:
- return None
+ return root
data_part = self.data_part(depth)
if self.requires_children == True \
and len([c for c in self if c.masked == False]) == 0: