diff options
author | Noman Arshad <nomanarshad94@yahoo.com> | 2020-08-04 23:39:28 +0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-04 11:39:28 -0700 |
commit | e3c52130add2ed5f7f0b9442b3b2742c09eb2de0 (patch) | |
tree | ab222a0dd57009dd36c72e325ddbb9e318244b26 /numpy/distutils/fcompiler | |
parent | 593ef5fc5a02fbcd6eeb70a59684b3b21c9cc643 (diff) | |
download | numpy-e3c52130add2ed5f7f0b9442b3b2742c09eb2de0.tar.gz |
MAINT: Chain exception in ``distutils/fcompiler/environment.py``. (#16962)
Fixup exception chaining and more detailed exception message
Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
Co-authored-by: Ross Barnowski <rossbar@berkeley.edu>
Diffstat (limited to 'numpy/distutils/fcompiler')
-rw-r--r-- | numpy/distutils/fcompiler/environment.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/numpy/distutils/fcompiler/environment.py b/numpy/distutils/fcompiler/environment.py index 21a5be003..ecd4d9989 100644 --- a/numpy/distutils/fcompiler/environment.py +++ b/numpy/distutils/fcompiler/environment.py @@ -33,7 +33,10 @@ class EnvironmentConfig: try: conf_desc = self._conf_keys[name] except KeyError: - raise AttributeError(name) + raise AttributeError( + f"'EnvironmentConfig' object has no attribute '{name}'" + ) from None + return self._get_var(name, conf_desc) def get(self, name, default=None): |