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 b6278e3

Browse filesBrowse files
committed
MNT: use else block to localize exceptions
1 parent 55c266c commit b6278e3
Copy full SHA for b6278e3

File tree

Expand file treeCollapse file tree

1 file changed

+3
-1
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+3
-1
lines changed

‎lib/matplotlib/font_manager.py

Copy file name to clipboardExpand all lines: lib/matplotlib/font_manager.py
+3-1Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -896,11 +896,13 @@ def set_size(self, size):
896896
except ValueError:
897897
try:
898898
scale = font_scalings[size]
899-
size = scale * FontManager.get_default_size()
900899
except KeyError:
901900
raise ValueError(
902901
"Size is invalid. Valid font size are " + ", ".join(
903902
str(i) for i in font_scalings.keys()))
903+
else:
904+
size = scale * FontManager.get_default_size()
905+
904906
self._size = size
905907

906908
def set_file(self, file):

0 commit comments

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