diff options
| author | Eric Wieser <wieser.eric@gmail.com> | 2020-01-05 21:16:11 +0000 |
|---|---|---|
| committer | Eric Wieser <wieser.eric@gmail.com> | 2020-01-05 21:22:53 +0000 |
| commit | da0497fdf35a7bf851f3625b0df07cde950f5f49 (patch) | |
| tree | 2bfd303e0c20edbbc2b0523b852f6f9710e4dd92 /numpy/distutils/command | |
| parent | 6253ff78be7f21898178799758717bfe59368b94 (diff) | |
| download | numpy-da0497fdf35a7bf851f3625b0df07cde950f5f49.tar.gz | |
MAINT: cleanup use of sys.exc_info
This code originates from python 2.6, before there was an `as` clause in `except`.
This removes all callers of `numpy.distutils.compat.get_exception`.
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 b9f2fa76e..cd9c0ca44 100644 --- a/numpy/distutils/command/config.py +++ b/numpy/distutils/command/config.py @@ -24,7 +24,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' @@ -52,8 +51,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 @@ -96,8 +94,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 |
