Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit aa21ed8

Browse filesBrowse files
committed
Suppress exception chaining in colormap lookup.
Replace ``` Traceback (most recent call last): File "../matplotlib/cm.py", line 131, in __getitem__ return self._cmaps[item].copy() KeyError: 'foo' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "<string>", line 4, in <module> File ".../matplotlib/cm.py", line 133, in __getitem__ raise KeyError(f"{item!r} is not a known colormap name") KeyError: "'foo' is not a known colormap name" ``` by just the latter block.
1 parent d3cc9d7 commit aa21ed8
Copy full SHA for aa21ed8

File tree

Expand file treeCollapse file tree

1 file changed

+1
-1
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+1
-1
lines changed

‎lib/matplotlib/cm.py

Copy file name to clipboardExpand all lines: lib/matplotlib/cm.py
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ def __getitem__(self, item):
130130
try:
131131
return self._cmaps[item].copy()
132132
except KeyError:
133-
raise KeyError(f"{item!r} is not a known colormap name")
133+
raise KeyError(f"{item!r} is not a known colormap name") from None
134134

135135
def __iter__(self):
136136
return iter(self._cmaps)

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.