1.1 --- a/main.py Sat Oct 10 00:14:25 2015 +0200
1.2 +++ b/main.py Sat Oct 10 01:45:55 2015 +0200
1.3 @@ -166,9 +166,10 @@
1.4 pim = PIL.Image.open(output_filename).convert("RGB")
1.5 im = SimpleImage(list(pim.getdata()), pim.size)
1.6
1.7 - result = count_colours(im, 4)
1.8 - if result is not None:
1.9 - y, colours = result
1.10 + try:
1.11 + count_colours(im, 4)
1.12 + except ValueError, exc:
1.13 + y, colours = exc.args
1.14 print "Image %s: row %d has the following colours: %s" % (output_filename, y, "; ".join([repr(c) for c in colours]))
1.15
1.16 # vim: tabstop=4 expandtab shiftwidth=4