File tree Expand file tree Collapse file tree 1 file changed +5
-8
lines changed Expand file tree Collapse file tree 1 file changed +5
-8
lines changed Original file line number Diff line number Diff line change @@ -1858,14 +1858,11 @@ def __getstate__(self):
1858
1858
# add version information to the state
1859
1859
state ['__mpl_version__' ] = _mpl_version
1860
1860
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
1869
1866
1870
1867
# set all the layoutbox information to None. kiwisolver objects can't
1871
1868
# be pickled, so we lose the layout options at this point.
You can’t perform that action at this time.
0 commit comments