From: Esko Kokkonen Date: Thu, 5 Apr 2012 13:09:13 +0000 (+0300) Subject: Change error messages for matplotlib X-Git-Url: http://git.itanic.dy.fi/?p=emerge-timer;a=commitdiff_plain;h=1031cc2c8e108a4ea315870892a2476b261596df Change error messages for matplotlib --- diff --git a/emerge-timer.py b/emerge-timer.py index 359beb0..b12b8c4 100755 --- a/emerge-timer.py +++ b/emerge-timer.py @@ -623,11 +623,13 @@ if __name__ == "__main__": try: import matplotlib.pyplot as plt matplotWorking = True - except Exception: - print "Cannot initialize matplotlib!" - print "Check that you have properly installet matplotlib." + except ImportError: + print(RED("Cannot initialize matplotlib!")) + print(RED("Check that you have properly installed matplotlib.\n")) matplotWorking = False + sys.argv.pop(sys.argv.index(arg)) + if arg == "--no-color": green_start = "" color_stop = ""