summaryrefslogtreecommitdiff
path: root/numpy/distutils/command/config.py
diff options
context:
space:
mode:
authorAbhay Raghuvanshi <abhayaman669@gmail.com>2021-03-19 01:49:20 +0530
committerGitHub <noreply@github.com>2021-03-18 14:19:20 -0600
commit9c68c2f7b1b2128a3b4af2134565f60d286fa8b9 (patch)
tree6ce82ac0a4e3074f89b0d2b883d2e02345f90b3d /numpy/distutils/command/config.py
parentbb7a31a6a852ecc64d3f7cffb70121fc8bef20eb (diff)
downloadnumpy-9c68c2f7b1b2128a3b4af2134565f60d286fa8b9.tar.gz
MAINT: Added Chain exceptions where appropriate (#18394)
* Added chain exception in _bits_of func * Added chain exception * Added chain exception in unixccompiler.py * Added chain exception in config.py * Added chain exception in fcompiler __init__.py * Added chain exception in compaq.py * Added chain exception in format.py * Updated raise chain exception * STY: Break long line. Co-authored-by: Charles Harris <charlesr.harris@gmail.com>
Diffstat (limited to 'numpy/distutils/command/config.py')
-rw-r--r--numpy/distutils/command/config.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/numpy/distutils/command/config.py b/numpy/distutils/command/config.py
index 8b735677a..1f4037bb5 100644
--- a/numpy/distutils/command/config.py
+++ b/numpy/distutils/command/config.py
@@ -64,7 +64,7 @@ class config(old_config):
% (e, self.compiler.__class__.__name__)
print(textwrap.dedent("""\
============================================================================"""))
- raise distutils.errors.DistutilsPlatformError(msg)
+ raise distutils.errors.DistutilsPlatformError(msg) from e
# After MSVC is initialized, add an explicit /MANIFEST to linker
# flags. See issues gh-4245 and gh-4101 for details. Also
@@ -97,9 +97,8 @@ class config(old_config):
try:
ret = mth(*((self,)+args))
except (DistutilsExecError, CompileError) as e:
- str(e)
self.compiler = save_compiler
- raise CompileError
+ raise CompileError from e
self.compiler = save_compiler
return ret