You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
more conservative setattr_cm broke mplcairo #17646
Trying to run tight_layout with mplcairo broke since #17620 with
ValueError: trying to set draw_gouraud_triangles which is not a method, property, or instance level attribute
because the check isinstance(cls_orig, types.FunctionType) fails for extension methods (such as GraphicsContextRendererCairo.<any method>). Looks like a better check is actually something like isinstance(orig, types.MethodType) and hasattr(type(obj), attr) (the first isinstance check verifies that orig is a bound method and then we just check that the attribute exists on the class and assume that if invoking the descriptor on it gives us a bound method, then we're good) -- at least it works for mplcairo...
Activity
MNT: make _setattr_cm more forgiving
tacaswell commentedon Jun 16, 2020
I thought we had backported #17620