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

Skip to content

Commit 51ea99f

Browse files
jsjeelshahQuLogic
authored andcommitted
Remove deprecated code from _fontconfig_patterns
1 parent f80ff65 commit 51ea99f

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
Removal change template
2+
~~~~~~~~~~~~~~~~~~~~~~~
3+
4+
@_api.delete_parameter("3.7", "raw") was removed from gridpec.py
5+
and
6+
_api.warn_deprecated function removed from _fontcongif_patterns.py

lib/matplotlib/_fontconfig_pattern.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -97,13 +97,7 @@ def parse_fontconfig_pattern(pattern):
9797
props["size"] = [*parse["sizes"]]
9898
for prop in parse.get("properties", []):
9999
if len(prop) == 1:
100-
if prop[0] not in _CONSTANTS:
101-
_api.warn_deprecated(
102-
"3.7", message=f"Support for unknown constants "
103-
f"({prop[0]!r}) is deprecated since %(since)s and "
104-
f"will be removed %(removal)s.")
105-
continue
106-
prop = _CONSTANTS[prop[0]]
100+
prop = _api.check_getitem(_CONSTANTS, property=prop[0])
107101
k, *v = prop
108102
props.setdefault(k, []).extend(map(_value_unescape, v))
109103
return props

lib/matplotlib/tests/test_fontconfig_pattern.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,5 +73,5 @@ def test_fontconfig_str():
7373

7474

7575
def test_fontconfig_unknown_constant():
76-
with pytest.warns(DeprecationWarning):
76+
with pytest.raises(ValueError, match="'unknown' is not a valid value for property"):
7777
FontProperties(":unknown")

0 commit comments

Comments
 (0)