Commit d9b8269c3566971c1f5cd80550452e06f2fe860c
1 parent
03b0aa5a
Do not exist with non-zero sys.exit() in case that matplotlib is not installed
Showing
5 changed files
with
14 additions
and
7 deletions
examples/show_butterfly.py
examples/show_model.py
examples/show_pha.py
examples/show_pull_evolution.py
| ... | ... | @@ -23,11 +23,13 @@ import csv |
| 23 | 23 | try: |
| 24 | 24 | import matplotlib.pyplot as plt |
| 25 | 25 | except: |
| 26 | - sys.exit('This script needs the "matplotlib" module') | |
| 26 | + print('This script needs the "matplotlib" module') | |
| 27 | + sys.exit() | |
| 27 | 28 | try: |
| 28 | 29 | import numpy as np |
| 29 | 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 | 24 | import matplotlib.pyplot as plt |
| 25 | 25 | import matplotlib.mlab as mlab |
| 26 | 26 | except: |
| 27 | - sys.exit('This script needs the "matplotlib" module') | |
| 27 | + print('This script needs the "matplotlib" module') | |
| 28 | + sys.exit() | |
| 28 | 29 | try: |
| 29 | 30 | import numpy as np |
| 30 | 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 | # ====================== # | ... | ... |