File tree 2 files changed +7
-6
lines changed
2 files changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -898,7 +898,7 @@ def _tight_layout(self):
898
898
self ._figure .tight_layout ()
899
899
for attr , spinbox in self ._spinboxes .items ():
900
900
spinbox .blockSignals (True )
901
- spinbox .setValue (vars (self ._figure .subplotpars )[ attr ] )
901
+ spinbox .setValue (getattr (self ._figure .subplotpars , attr ) )
902
902
spinbox .blockSignals (False )
903
903
self ._figure .canvas .draw_idle ()
904
904
Original file line number Diff line number Diff line change @@ -325,11 +325,12 @@ def draw_if_interactive():
325
325
# show is already present, as the latter may be here for backcompat.
326
326
manager_class = getattr (getattr (backend_mod , "FigureCanvas" , None ),
327
327
"manager_class" , None )
328
- # We can't compare directly manager_class.pyplot_show and FMB.pyplot_show
329
- # because pyplot_show is a classmethod so the above constructs are bound
330
- # classmethods, & thus always different (being bound to different classes).
331
- manager_pyplot_show = vars (manager_class ).get ("pyplot_show" )
332
- base_pyplot_show = vars (FigureManagerBase ).get ("pyplot_show" )
328
+ # We can't compare directly manager_class.pyplot_show and FMB.pyplot_show because
329
+ # pyplot_show is a classmethod so the above constructs are bound classmethods, and
330
+ # thus always different (being bound to different classes). We also have to use
331
+ # getattr_static instead of vars as manager_class could have no __dict__.
332
+ manager_pyplot_show = inspect .getattr_static (manager_class , "pyplot_show" , None )
333
+ base_pyplot_show = inspect .getattr_static (FigureManagerBase , "pyplot_show" , None )
333
334
if (show is None
334
335
or (manager_pyplot_show is not None
335
336
and manager_pyplot_show != base_pyplot_show )):
You can’t perform that action at this time.
0 commit comments