8000 Merge pull request #22280 from anntzer/fpc · matplotlib/matplotlib@1791022 · GitHub
[go: up one dir, main page]

Skip to content

Commit 1791022

Browse files
authored
Merge pull request #22280 from anntz 8000 er/fpc
Simplify FontProperties.copy().
2 parents f393802 + 6ba21a3 commit 1791022

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