Commit f4d9e9c
committed
BUG: __getattr__ must raise AttributeError if name not found
PR matplotlib#20733 added module-level `__getattr__` functions to several
modules. All of the functions with the exception of the one in
`matplotlib.style.core` had a terminal `raise AttributeError` to
handle unmatched attributes.
The omission in `matplotlib.style.core` was probably
unintentional; it results in confusing and buggy behavior
such as:
```pycon
>>> import matplotlib.style.core
>>> if hasattr(matplotlib.style.core, '__warningregistry__'):
... del matplotlib.style.core.__warningregistry__
...
Traceback (most recent call last):
File "<stdin>", line 2, in <module>
AttributeError: __warningregistry__
```
This causes problems in the unit tests for astropy affiliated
packages. See astropy/astropy#12038.1 parent b61e76a commit f4d9e9c
1 file changed
+1
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| 36 | + | |
36 | 37 | | |
37 | 38 | | |
38 | 39 | | |
| |||
0 commit comments