File tree Expand file tree Collapse file tree 2 files changed +7
-6
lines changed
Expand file tree Collapse file tree 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):
898898 self ._figure .tight_layout ()
899899 for attr , spinbox in self ._spinboxes .items ():
900900 spinbox .blockSignals (True )
901- spinbox .setValue (vars (self ._figure .subplotpars )[ attr ] )
901+ spinbox .setValue (getattr (self ._figure .subplotpars , attr ) )
902902 spinbox .blockSignals (False )
903903 self ._figure .canvas .draw_idle ()
904904
Original file line number Diff line number Diff line change @@ -325,11 +325,12 @@ def draw_if_interactive():
325325 # show is already present, as the latter may be here for backcompat.
326326 manager_class = getattr (getattr (backend_mod , "FigureCanvas" , None ),
327327 "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 )
333334 if (show is None
334335 or (manager_pyplot_show is not None
335336 and manager_pyplot_show != base_pyplot_show )):
You can’t perform that action at this time.
0 commit comments