Commit f3f1a514dde5cd042585e05c4ad185d7c6daef60
1 parent
9a1b801f
Correct import exception
Showing
10 changed files
with
10 additions
and
10 deletions
examples/show_butterfly.py
| @@ -25,7 +25,7 @@ try: | @@ -25,7 +25,7 @@ try: | ||
| 25 | import matplotlib.pyplot as plt | 25 | import matplotlib.pyplot as plt |
| 26 | plt.figure() | 26 | plt.figure() |
| 27 | plt.close() | 27 | plt.close() |
| 28 | -except ImportError: | 28 | +except ImportError, RuntimeError: |
| 29 | print('This script needs the "matplotlib" module') | 29 | print('This script needs the "matplotlib" module') |
| 30 | sys.exit() | 30 | sys.exit() |
| 31 | 31 |
examples/show_model.py
| @@ -25,7 +25,7 @@ try: | @@ -25,7 +25,7 @@ try: | ||
| 25 | import matplotlib.pyplot as plt | 25 | import matplotlib.pyplot as plt |
| 26 | plt.figure() | 26 | plt.figure() |
| 27 | plt.close() | 27 | plt.close() |
| 28 | -except ImportError: | 28 | +except ImportError, RuntimeError: |
| 29 | print('This script needs the "matplotlib" module') | 29 | print('This script needs the "matplotlib" module') |
| 30 | sys.exit() | 30 | sys.exit() |
| 31 | 31 |
examples/show_obs.py
| @@ -25,7 +25,7 @@ try: | @@ -25,7 +25,7 @@ try: | ||
| 25 | import matplotlib.pyplot as plt | 25 | import matplotlib.pyplot as plt |
| 26 | plt.figure() | 26 | plt.figure() |
| 27 | plt.close() | 27 | plt.close() |
| 28 | -except ImportError: | 28 | +except ImportError, RuntimeError: |
| 29 | print('This script needs the "matplotlib" module') | 29 | print('This script needs the "matplotlib" module') |
| 30 | sys.exit() | 30 | sys.exit() |
| 31 | 31 |
examples/show_pha.py
| @@ -26,7 +26,7 @@ try: | @@ -26,7 +26,7 @@ try: | ||
| 26 | import matplotlib.pyplot as plt | 26 | import matplotlib.pyplot as plt |
| 27 | plt.figure() | 27 | plt.figure() |
| 28 | plt.close() | 28 | plt.close() |
| 29 | -except ImportError: | 29 | +except ImportError, RuntimeError: |
| 30 | print('This script needs the "matplotlib" module') | 30 | print('This script needs the "matplotlib" module') |
| 31 | sys.exit() | 31 | sys.exit() |
| 32 | 32 |
examples/show_pull_evolution.py
| @@ -25,7 +25,7 @@ try: | @@ -25,7 +25,7 @@ try: | ||
| 25 | import matplotlib.pyplot as plt | 25 | import matplotlib.pyplot as plt |
| 26 | plt.figure() | 26 | plt.figure() |
| 27 | plt.close() | 27 | plt.close() |
| 28 | -except ImportError: | 28 | +except ImportError, RuntimeError: |
| 29 | print('This script needs the "matplotlib" module') | 29 | print('This script needs the "matplotlib" module') |
| 30 | sys.exit() | 30 | sys.exit() |
| 31 | try: | 31 | try: |
examples/show_pull_histogram.py
| @@ -26,7 +26,7 @@ try: | @@ -26,7 +26,7 @@ try: | ||
| 26 | import matplotlib.mlab as mlab | 26 | import matplotlib.mlab as mlab |
| 27 | plt.figure() | 27 | plt.figure() |
| 28 | plt.close() | 28 | plt.close() |
| 29 | -except ImportError: | 29 | +except ImportError, RuntimeError: |
| 30 | print('This script needs the "matplotlib" module') | 30 | print('This script needs the "matplotlib" module') |
| 31 | sys.exit() | 31 | sys.exit() |
| 32 | try: | 32 | try: |
examples/show_response.py
| @@ -26,7 +26,7 @@ try: | @@ -26,7 +26,7 @@ try: | ||
| 26 | import matplotlib.pyplot as plt | 26 | import matplotlib.pyplot as plt |
| 27 | plt.figure() | 27 | plt.figure() |
| 28 | plt.close() | 28 | plt.close() |
| 29 | -except ImportError: | 29 | +except ImportError, RuntimeError: |
| 30 | print('This script needs the "matplotlib" module') | 30 | print('This script needs the "matplotlib" module') |
| 31 | sys.exit() | 31 | sys.exit() |
| 32 | 32 |
examples/show_sensitivity.py
| @@ -26,7 +26,7 @@ try: | @@ -26,7 +26,7 @@ try: | ||
| 26 | import matplotlib.pyplot as plt | 26 | import matplotlib.pyplot as plt |
| 27 | plt.figure() | 27 | plt.figure() |
| 28 | plt.close() | 28 | plt.close() |
| 29 | -except ImportError: | 29 | +except ImportError, RuntimeError: |
| 30 | print('This script needs the "matplotlib" module') | 30 | print('This script needs the "matplotlib" module') |
| 31 | sys.exit() | 31 | sys.exit() |
| 32 | 32 |
examples/show_spectrum.py
| @@ -25,7 +25,7 @@ try: | @@ -25,7 +25,7 @@ try: | ||
| 25 | import matplotlib.pyplot as plt | 25 | import matplotlib.pyplot as plt |
| 26 | plt.figure() | 26 | plt.figure() |
| 27 | plt.close() | 27 | plt.close() |
| 28 | -except ImportError: | 28 | +except ImportError, RuntimeError: |
| 29 | print('This script needs the "matplotlib" module') | 29 | print('This script needs the "matplotlib" module') |
| 30 | sys.exit() | 30 | sys.exit() |
| 31 | 31 |
examples/show_ts_distribution.py
| @@ -26,7 +26,7 @@ try: | @@ -26,7 +26,7 @@ try: | ||
| 26 | import matplotlib.pyplot as plt | 26 | import matplotlib.pyplot as plt |
| 27 | plt.figure() | 27 | plt.figure() |
| 28 | plt.close() | 28 | plt.close() |
| 29 | -except ImportError: | 29 | +except ImportError, RuntimeError: |
| 30 | print('This script needs the "matplotlib" module') | 30 | print('This script needs the "matplotlib" module') |
| 31 | sys.exit() | 31 | sys.exit() |
| 32 | try: | 32 | try: |