File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1858,14 +1858,11 @@ def __getstate__(self):
18581858 # add version information to the state
18591859 state ['__mpl_version__' ] = _mpl_version
18601860
1861- # check to see if the figure has a manager and whether it is registered
1862- # with pyplot
1863- if getattr (self .canvas , 'manager' , None ) is not None :
1864- manager = self .canvas .manager
1865- import matplotlib ._pylab_helpers
1866- if manager in list (six .itervalues (
1867- matplotlib ._pylab_helpers .Gcf .figs )):
1868- state ['_restore_to_pylab' ] = True
1861+ # check whether the figure manager (if any) is registered with pyplot
1862+ from matplotlib import _pylab_helpers
1863+ if getattr (self .canvas , 'manager' , None ) \
1864+ in _pylab_helpers .Gcf .figs .values ():
1865+ state ['_restore_to_pylab' ] = True
18691866
18701867 # set all the layoutbox information to None. kiwisolver objects can't
18711868 # be pickled, so we lose the layout options at this point.
You can’t perform that action at this time.
0 commit comments