From: Adam Spiers Date: Sat, 5 Nov 2011 23:33:31 +0000 (+0000) Subject: avoid cryptic StopIteration failure from make when 'make check' is run before 'make... X-Git-Tag: release/2.15.21-1~37 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=46081ce43fa0b83415150102357474b4e1da17e6;p=lilypond.git avoid cryptic StopIteration failure from make when 'make check' is run before 'make test-baseline' --- diff --git a/scripts/build/output-distance.py b/scripts/build/output-distance.py index d2d55d77fa..941f879f47 100755 --- a/scripts/build/output-distance.py +++ b/scripts/build/output-distance.py @@ -827,7 +827,15 @@ class ComparisonData: def compare_trees (self, dir1, dir2): self.compare_directories (dir1, dir2) - (root, dirs, files) = os.walk (dir1).next () + try: + (root, dirs, files) = os.walk (dir1).next () + except StopIteration: + if dir1.endswith("-baseline"): + sys.stderr.write("Failed to walk through %s. This can be caused by forgetting to run make test-baseline.\n" % dir1) + else: + sys.stderr.write("Failed to walk through %s; please check it exists.\n" % dir1) + sys.exit(1) + for d in dirs: d1 = os.path.join (dir1, d) d2 = os.path.join (dir2, d)