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

Skip to content

Commit 97e7dac

Browse files
committed
Address comments
- #7931 (comment) - #7931 (comment)
1 parent 30031b5 commit 97e7dac

2 files changed

Lines changed: 5 additions & 4 deletions

File tree

lib/matplotlib/font_manager.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1204,8 +1204,8 @@ def score_weight(self, weight1, weight2):
12041204

12051205
# exact match of the weight names (e.g. weight1 == weight2 == "regular")
12061206
if (isinstance(weight1, six.string_types) and
1207-
isinstance(weight2, six.string_types) and
1208-
weight1 == weight2):
1207+
isinstance(weight2, six.string_types) and
1208+
weight1 == weight2):
12091209
return 0.0
12101210
try:
12111211
weightval1 = int(weight1)

lib/matplotlib/tests/test_font_manager.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,9 @@ def test_score_weight():
4040
assert (0 ==
4141
fontManager.score_weight("regular", "regular") ==
4242
fontManager.score_weight("bold", "bold") <
43-
fontManager.score_weight("normal", "regular") ==
44-
fontManager.score_weight(400, 400) <
43+
fontManager.score_weight(400, 400) ==
44+
# "normal" and "regular" have the same numerical weight
45+
fontManager.score_weight("normal", "regular") <
4546
fontManager.score_weight("normal", "bold"))
4647

4748

0 commit comments

Comments
 (0)