more conservative setattr_cm broke mplcairo #17646
Labels
Release critical
For bugs that make the library unusable (segfaults, incorrect plots, etc) and major regressions.
Milestone
Trying to run tight_layout with mplcairo broke since #17620 with
because the check
isinstance(cls_orig, types.FunctionType)
fails for extension methods (such asGraphicsContextRendererCairo.<any method>
). Looks like a better check is actually something likeisinstance(orig, types.MethodType) and hasattr(type(obj), attr)
(the first isinstance check verifies thatorig
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...The text was updated successfully, but these errors were encountered: