| 86 | self.fcompiler.show_customization() |
| 87 | |
| 88 | def _wrap_method(self, mth, lang, args): |
| 89 | from distutils.ccompiler import CompileError |
| 90 | from distutils.errors import DistutilsExecError |
| 91 | save_compiler = self.compiler |
| 92 | if lang in ['f77', 'f90']: |
| 93 | self.compiler = self.fcompiler |
| 94 | if self.compiler is None: |
| 95 | raise CompileError('%s compiler is not set' % (lang,)) |
| 96 | try: |
| 97 | ret = mth(*((self,)+args)) |
| 98 | except (DistutilsExecError, CompileError) as e: |
| 99 | self.compiler = save_compiler |
| 100 | raise CompileError from e |
| 101 | self.compiler = save_compiler |
| 102 | return ret |
| 103 | |
| 104 | def _compile (self, body, headers, include_dirs, lang): |
| 105 | src, obj = self._wrap_method(old_config._compile, lang, |