Skip to content

Commit 589f288

Browse files
committed
Removed handling of override builtin from ColorMaRegistry
1 parent 8be606a commit 589f288

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

lib/matplotlib/cm.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,6 @@ class ColormapRegistry(Mapping):
7878
def __init__(self, cmaps):
7979
self._cmaps = cmaps
8080
self._builtin_cmaps = tuple(cmaps)
81-
# A shim to allow register_cmap() to force an override
82-
self._allow_override_builtin = False
8381

8482
def __getitem__(self, item):
8583
try:
@@ -141,10 +139,8 @@ def register(self, cmap, *, name=None, force=False):
141139
# unless explicitly asked to
142140
raise ValueError(
143141
f'A colormap named "{name}" is already registered.')
144-
elif (name in self._builtin_cmaps
145-
and not self._allow_override_builtin):
146-
# We don't allow overriding a builtin unless privately
147-
# coming from register_cmap()
142+
elif name in self._builtin_cmaps:
143+
# We don't allow overriding a builtin
148144
raise ValueError("Re-registering the builtin cmap "
149145
f"{name!r} is not allowed.")
150146

0 commit comments

Comments
 (0)