8000 Merge pull request #13468 from anntzer/colorexceptionchaining · matplotlib/matplotlib@10aee8d · GitHub
[go: up one dir, main page]

Skip to content

Commit 10aee8d

Browse files
authored
Merge pull request #13468 from anntzer/colorexceptionchaining
Suppress chaining of cache lookup failure in color conversion.
2 parents f0d62eb + 1aa5a83 commit 10aee8d

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lib/matplotlib/colors.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,8 @@ def to_rgba(c, alpha=None):
172172
try:
173173
rgba = _colors_full_map.cache[c, alpha]
174174
except (KeyError, TypeError): # Not in cache, or unhashable.
175+
rgba = None
176+
if rgba is None: # Suppress exception chaining of cache lookup failure.
175177
rgba = _to_rgba_no_colorcycle(c, alpha)
176178
try:
177179
_colors_full_map.cache[c, alpha] = rgba

0 commit comments

Comments
 (0)
0