8000 Simplify FontProperties.copy(). · matplotlib/matplotlib@6ba21a3 · GitHub
[go: up one dir, main page]

Skip to content

Commit 6ba21a3

Browse files
committed
Simplify FontProperties.copy().
1 parent 28e5798 commit 6ba21a3

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

lib/matplotlib/font_manager.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
# - 'light' is an invalid weight value, remove it.
2525

2626
from base64 import b64encode
27+
import copy
2728
import dataclasses
2829
from functools import lru_cache
2930
from io import BytesIO
@@ -964,9 +965,7 @@ def set_math_fontfamily(self, fontfamily):
964965

965966
def copy(self):
966967
"""Return a copy of self."""
967-
new = type(self)()
968-
vars(new).update(vars(self))
969-
return new
968+
return copy.copy(self)
970969

971970

972971
class _JSONEncoder(json.JSONEncoder):

0 commit comments

Comments
 (0)
0