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

Skip to content

Commit bb3c0b5

Browse files
authored
Merge pull request #15877 from anntzer/rctbchain
MNT: Suppress exception chaining on rc validator failure.
2 parents 75934a0 + afb7dce commit bb3c0b5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/matplotlib/__init__.py

Lines 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)