File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -235,31 +235,14 @@ def get_latex_manager():
235235 LatexManagerFactory .previous_instance = new_inst
236236 return new_inst
237237
238- class WeakSet (object ):
239- # TODO: Poor man's weakref.WeakSet.
240- # Remove this once python 2.6 support is dropped from matplotlib.
241-
242- def __init__ (self ):
243- self .weak_key_dict = weakref .WeakKeyDictionary ()
244-
245- def add (self , item ):
246- self .weak_key_dict [item ] = None
247-
248- def discard (self , item ):
249- if item in self .weak_key_dict :
250- del self .weak_key_dict [item ]
251-
252- def __iter__ (self ):
253- return six .iterkeys (self .weak_key_dict )
254-
255238
256239class LatexManager (object ):
257240 """
258241 The LatexManager opens an instance of the LaTeX application for
259242 determining the metrics of text elements. The LaTeX environment can be
260243 modified by setting fonts and/or a custem preamble in the rc parameters.
261244 """
262- _unclean_instances = WeakSet ()
245+ _unclean_instances = weakref . WeakSet ()
263246
264247 @staticmethod
265248 def _build_latex_header ():
You can’t perform that action at this time.
0 commit comments