Do not start Tk if only to exit

This commit is contained in:
Andrew Murray 2016-05-11 00:29:39 +10:00
parent a69e477605
commit 6f94974595

View File

@ -66,12 +66,12 @@ class PaintCanvas(Canvas):
# #
# main # main
root = Tk()
if len(sys.argv) != 2: if len(sys.argv) != 2:
print("Usage: painter file") print("Usage: painter file")
sys.exit(1) sys.exit(1)
root = Tk()
im = Image.open(sys.argv[1]) im = Image.open(sys.argv[1])
if im.mode != "RGB": if im.mode != "RGB":