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 afb7dce

Browse filesBrowse files
committed
Suppress exception chaining on rc validator failure.
This changes the traceback from Traceback (most recent call last): File ".../matplotlib/__init__.py", line 768, in __setitem__ cval = self.validate[key](val) File ".../matplotlib/rcsetup.py", line 67, in __call__ raise ValueError('Unrecognized %s string %r: valid strings are %s' ValueError: Unrecognized capstyle string 'foobar': valid strings are ['butt', 'round', 'projecting'] During handling of the above exception, another exception occurred: Traceback (most recent call last): File "<string>", line 4, in <module> File ".../matplotlib/__init__.py", line 770, in __setitem__ raise ValueError("Key %s: %s" % (key, str(ve))) ValueError: Key lines.solid_capstyle: Unrecognized capstyle string 'foobar': valid strings are ['butt', 'round', 'projecting'] to Traceback (most recent call last): File "<string>", line 4, in <module> File ".../matplotlib/__init__.py", line 770, in __setitem__ raise ValueError(f"Key {key}: {ve}") from None ValueError: Key lines.solid_capstyle: Unrecognized capstyle string 'foobar': valid strings are ['butt', 'round', 'projecting']
1 parent 8a1cc04 commit afb7dce
Copy full SHA for afb7dce

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/__init__.py

Copy file name to clipboardExpand all lines: lib/matplotlib/__init__.py
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -767,7 +767,7 @@ def __setitem__(self, key, val):
767767
try:
768768
cval = self.validate[key](val)
769769
except ValueError as ve:
770-
raise ValueError("Key %s: %s" % (key, str(ve)))
770+
raise ValueError(f"Key {key}: {ve}") from None
771771
dict.__setitem__(self, key, cval)
772772
except KeyError:
773773
raise KeyError(

0 commit comments

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