diff options
author | Charles Harris <charlesr.harris@gmail.com> | 2020-01-05 17:27:25 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-01-05 17:27:25 -0700 |
commit | ba81c4200f289b393755d954f7450804ec8f897a (patch) | |
tree | 9c5105f9d1974b355fd55a3adab09d83e2846490 /numpy/distutils/command | |
parent | b5739e8a81c71174b75cf4c8f9de4eccaa7eca2c (diff) | |
parent | da0497fdf35a7bf851f3625b0df07cde950f5f49 (diff) | |
download | numpy-ba81c4200f289b393755d954f7450804ec8f897a.tar.gz |
Merge pull request #15248 from eric-wieser/avoid-exc_info
MAINT: cleanup use of sys.exc_info
Diffstat (limited to 'numpy/distutils/command')
-rw-r--r-- | numpy/distutils/command/config.py | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/numpy/distutils/command/config.py b/numpy/distutils/command/config.py index 9a4665393..2c833aad7 100644 --- a/numpy/distutils/command/config.py +++ b/numpy/distutils/command/config.py @@ -22,7 +22,6 @@ from numpy.distutils.command.autodist import (check_gcc_function_attribute, check_inline, check_restrict, check_compiler_gcc4) -from numpy.distutils.compat import get_exception LANG_EXT['f77'] = '.f' LANG_EXT['f90'] = '.f90' @@ -50,8 +49,7 @@ class config(old_config): if not self.compiler.initialized: try: self.compiler.initialize() - except IOError: - e = get_exception() + except IOError as e: msg = textwrap.dedent("""\ Could not initialize compiler instance: do you have Visual Studio installed? If you are trying to build with MinGW, please use "python setup.py @@ -94,8 +92,8 @@ class config(old_config): self.compiler = self.fcompiler try: ret = mth(*((self,)+args)) - except (DistutilsExecError, CompileError): - str(get_exception()) + except (DistutilsExecError, CompileError) as e: + str(e) self.compiler = save_compiler raise CompileError self.compiler = save_compiler |