File tree 1 file changed +4
-8
lines changed 1 file changed +4
-8
lines changed Original file line number Diff line number Diff line change @@ -567,7 +567,6 @@ def __init__(self,
567
567
stretch = None ,
568
568
size = None ,
569
569
fname = None , # if set, it's a hardcoded filename to use
570
- _init = None , # used only by copy()
571
570
):
572
571
self ._family = _normalize_font_family (rcParams ['font.family' ])
573
572
self ._slant = rcParams ['font.style' ]
@@ -577,11 +576,6 @@ def __init__(self,
577
576
self ._size = rcParams ['font.size' ]
578
577
self ._file = None
579
578
580
- # This is used only by copy()
581
- if _init is not None :
582
- self .__dict__ .update (_init .__dict__ )
583
- return
584
-
585
579
if isinstance (family , str ):
586
580
# Treat family as a fontconfig pattern if it is the only
587
581
# parameter provided.
@@ -812,8 +806,10 @@ def set_fontconfig_pattern(self, pattern):
812
806
getattr (self , "set_" + key )(val )
813
807
814
808
def copy (self ):
815
- """Return a deep copy of self"""
816
- return FontProperties (_init = self )
809
+ """Return a copy of self."""
810
+ new = type (self )()
811
+ vars (new ).update (vars (self ))
812
+ return new
817
813
818
814
819
815
class JSONEncoder (json .JSONEncoder ):
You can’t perform that action at this time.
0 commit comments