summaryrefslogtreecommitdiff
path: root/numpy/f2py
diff options
context:
space:
mode:
authorIrit Katriel <1055913+iritkatriel@users.noreply.github.com>2023-04-11 08:47:55 +0100
committerGitHub <noreply@github.com>2023-04-11 09:47:55 +0200
commit26de8cb3c19361c45df0e8ca43945a687e213d43 (patch)
treea81e9da183b99277cc97c9fc8ca26b2949decf84 /numpy/f2py
parentfe893743b83173b72648dc79d86eda905230d1e9 (diff)
downloadnumpy-26de8cb3c19361c45df0e8ca43945a687e213d43.tar.gz
MAINT: remove usages of sys.exc_info (#23568)
This is similar to #15248, removing the remaining usages of sys.exc_info() that are no longer necessary.
Diffstat (limited to 'numpy/f2py')
-rw-r--r--numpy/f2py/diagnose.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/numpy/f2py/diagnose.py b/numpy/f2py/diagnose.py
index 21ee399f0..86d7004ab 100644
--- a/numpy/f2py/diagnose.py
+++ b/numpy/f2py/diagnose.py
@@ -30,15 +30,15 @@ def run():
try:
import numpy
has_newnumpy = 1
- except ImportError:
- print('Failed to import new numpy:', sys.exc_info()[1])
+ except ImportError as e:
+ print('Failed to import new numpy:', e)
has_newnumpy = 0
try:
from numpy.f2py import f2py2e
has_f2py2e = 1
- except ImportError:
- print('Failed to import f2py2e:', sys.exc_info()[1])
+ except ImportError as e:
+ print('Failed to import f2py2e:', e)
has_f2py2e = 0
try:
@@ -48,8 +48,8 @@ def run():
try:
import numpy_distutils
has_numpy_distutils = 1
- except ImportError:
- print('Failed to import numpy_distutils:', sys.exc_info()[1])
+ except ImportError as e:
+ print('Failed to import numpy_distutils:', e)
has_numpy_distutils = 0
if has_newnumpy: