Commit c654b9c
committed
Suppress exception chaining in FontProperties.
For `FontProperties(stretch=12345)`; before:
```
Traceback (most recent call last):
File ".../matplotlib/font_manager.py", line 888, in set_stretch
raise ValueError()
ValueError
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File ".../matplotlib/font_manager.py", line 695, in __init__
self.set_stretch(stretch)
File ".../matplotlib/font_manager.py", line 891, in set_stretch
raise ValueError("stretch is invalid") from err
ValueError: stretch is invalid
```
after
```
Traceback (most recent call last):
File "<string>", line 1, in <module>
File ".../matplotlib/font_manager.py", line 695, in __init__
self.set_stretch(stretch)
File ".../matplotlib/font_manager.py", line 900, in set_stretch
raise ValueError(f"{stretch=} is invalid")
ValueError: stretch=12345 is invalid
```1 parent 63e9ea3 commit c654b9c
1 file changed
+18
-10
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
860 | 860 | | |
861 | 861 | | |
862 | 862 | | |
| 863 | + | |
| 864 | + | |
| 865 | + | |
863 | 866 | | |
864 | 867 | | |
865 | | - | |
866 | | - | |
867 | 868 | | |
868 | | - | |
869 | | - | |
870 | | - | |
| 869 | + | |
| 870 | + | |
| 871 | + | |
| 872 | + | |
| 873 | + | |
| 874 | + | |
871 | 875 | | |
872 | 876 | | |
873 | 877 | | |
| |||
882 | 886 | | |
883 | 887 | | |
884 | 888 | | |
| 889 | + | |
| 890 | + | |
| 891 | + | |
885 | 892 | | |
886 | 893 | | |
887 | | - | |
888 | | - | |
889 | 894 | | |
890 | | - | |
891 | | - | |
892 | | - | |
| 895 | + | |
| 896 | + | |
| 897 | + | |
| 898 | + | |
| 899 | + | |
| 900 | + | |
893 | 901 | | |
894 | 902 | | |
895 | 903 | | |
| |||
0 commit comments