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/unixccompiler.py | |
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/unixccompiler.py')
-rw-r--r-- | numpy/distutils/unixccompiler.py | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/numpy/distutils/unixccompiler.py b/numpy/distutils/unixccompiler.py index 11b2cce52..0174f0d05 100644 --- a/numpy/distutils/unixccompiler.py +++ b/numpy/distutils/unixccompiler.py @@ -9,7 +9,6 @@ import os from distutils.errors import DistutilsExecError, CompileError from distutils.unixccompiler import * from numpy.distutils.ccompiler import replace_method -from numpy.distutils.compat import get_exception from numpy.distutils.misc_util import _commandline_dep_string if sys.version_info[0] < 3: @@ -56,8 +55,8 @@ def UnixCCompiler__compile(self, obj, src, ext, cc_args, extra_postargs, pp_opts try: self.spawn(self.compiler_so + cc_args + [src, '-o', obj] + deps + extra_postargs, display = display) - except DistutilsExecError: - msg = str(get_exception()) + except DistutilsExecError as e: + msg = str(e) raise CompileError(msg) # add commandline flags to dependency file @@ -128,8 +127,8 @@ def UnixCCompiler_create_static_lib(self, objects, output_libname, try: self.spawn(self.ranlib + [output_filename], display = display) - except DistutilsExecError: - msg = str(get_exception()) + except DistutilsExecError as e: + msg = str(e) raise LibError(msg) else: log.debug("skipping %s (up-to-date)", output_filename) |