Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit a228b1f

Browse files
committed
BUG: __getattr__ must raise AttributeError if name not found (again)
PR #20806 added another instance of a module-level `__getattr__` function that was missing a final `raise AttributeError` to catch unknown attributes. This is the same kind of bug as #20822. See also astropy/astropy#12038.
1 parent 0a4a10c commit a228b1f

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

lib/matplotlib/cm.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ def __getattr__(name):
3434
_api.warn_deprecated("3.5", name=name,
3535
alternative="rcParams['image.lut']")
3636
return _LUTSIZE
37+
raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
3738

3839

3940
_LUTSIZE = mpl.rcParams['image.lut']

0 commit comments

Comments
 (0)