Commit d9b8269c3566971c1f5cd80550452e06f2fe860c

Authored by Jürgen Knödlseder
1 parent 03b0aa5a

Do not exist with non-zero sys.exit() in case that matplotlib is not installed

examples/show_butterfly.py
@@ -23,7 +23,8 @@ import gammalib @@ -23,7 +23,8 @@ import gammalib
23 try: 23 try:
24 import matplotlib.pyplot as plt 24 import matplotlib.pyplot as plt
25 except: 25 except:
26 - sys.exit('This script needs the "matplotlib" module') 26 + print('This script needs the "matplotlib" module')
  27 + sys.exit()
27 28
28 29
29 # ============ # 30 # ============ #
examples/show_model.py
@@ -24,7 +24,8 @@ import gammalib @@ -24,7 +24,8 @@ import gammalib
24 try: 24 try:
25 import matplotlib.pyplot as plt 25 import matplotlib.pyplot as plt
26 except: 26 except:
27 - sys.exit('This script needs the "matplotlib" module') 27 + print('This script needs the "matplotlib" module')
  28 + sys.exit()
28 29
29 30
30 # ======================= # 31 # ======================= #
examples/show_pha.py
@@ -24,7 +24,8 @@ import gammalib @@ -24,7 +24,8 @@ import gammalib
24 try: 24 try:
25 import matplotlib.pyplot as plt 25 import matplotlib.pyplot as plt
26 except: 26 except:
27 - sys.exit('This script needs the "matplotlib" module') 27 + print('This script needs the "matplotlib" module')
  28 + sys.exit()
28 29
29 30
30 # ================= # 31 # ================= #
examples/show_pull_evolution.py
@@ -23,11 +23,13 @@ import csv @@ -23,11 +23,13 @@ import csv
23 try: 23 try:
24 import matplotlib.pyplot as plt 24 import matplotlib.pyplot as plt
25 except: 25 except:
26 - sys.exit('This script needs the "matplotlib" module') 26 + print('This script needs the "matplotlib" module')
  27 + sys.exit()
27 try: 28 try:
28 import numpy as np 29 import numpy as np
29 except: 30 except:
30 - sys.exit('This script needs the "numpy" module') 31 + print('This script needs the "numpy" module')
  32 + sys.exit()
31 33
32 34
33 # ====================== # 35 # ====================== #
examples/show_pull_histogram.py
@@ -24,11 +24,13 @@ try: @@ -24,11 +24,13 @@ try:
24 import matplotlib.pyplot as plt 24 import matplotlib.pyplot as plt
25 import matplotlib.mlab as mlab 25 import matplotlib.mlab as mlab
26 except: 26 except:
27 - sys.exit('This script needs the "matplotlib" module') 27 + print('This script needs the "matplotlib" module')
  28 + sys.exit()
28 try: 29 try:
29 import numpy as np 30 import numpy as np
30 except: 31 except:
31 - sys.exit('This script needs the "numpy" module') 32 + print('This script needs the "numpy" module')
  33 + sys.exit()
32 34
33 35
34 # ====================== # 36 # ====================== #