diff options
Diffstat (limited to 'numpy/distutils/command/config.py')
-rw-r--r-- | numpy/distutils/command/config.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/numpy/distutils/command/config.py b/numpy/distutils/command/config.py index 60881f4a3..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 @@ -92,12 +92,13 @@ class config(old_config): save_compiler = self.compiler if lang in ['f77', 'f90']: self.compiler = self.fcompiler + if self.compiler is None: + raise CompileError('%s compiler is not set' % (lang,)) 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 |