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 @@ -324,11 +324,12 @@ def draw_if_interactive():
324324 # show is already present, as the latter may be here for backcompat.
325325 manager_class = getattr (getattr (backend_mod , "FigureCanvas" , None ),
326326 "manager_class" , None )
327- # We can't compare directly manager_class.pyplot_show and FMB.pyplot_show
328- # because pyplot_show is a classmethod so the above constructs are bound
329- # classmethods, & thus always different (being bound to different classes).
330- manager_pyplot_show = vars (manager_class ).get ("pyplot_show" )
331- base_pyplot_show = vars (FigureManagerBase ).get ("pyplot_show" )
327+ # We can't compare directly manager_class.pyplot_show and FMB.pyplot_show because
328+ # pyplot_show is a classmethod so the above constructs are bound classmethods, and
329+ # thus always different (being bound to different classes). We also have to use
330+ # getattr_static instead of vars as manager_class could have no __dict__.
331+ manager_pyplot_show = inspect .getattr_static (manager_class , "pyplot_show" , None )
332+ base_pyplot_show = inspect .getattr_static (FigureManagerBase , "pyplot_show" , None )
332333 if (show is None
333334 or (manager_pyplot_show is not None
334335 and manager_pyplot_show != base_pyplot_show )):
You can’t perform that action at this time.
0 commit comments