diff --git a/lib/matplotlib/backends/backend_cairo.py b/lib/matplotlib/backends/backend_cairo.py index d13de790aaf2..f73a2ec3b376 100644 --- a/lib/matplotlib/backends/backend_cairo.py +++ b/lib/matplotlib/backends/backend_cairo.py @@ -96,7 +96,7 @@ def set_context(self, ctx): rect, *rest = ctx.copy_clip_rectangle_list() if rest: raise TypeError("Cannot infer surface size") - size = rect.width, rect.height + _, _, *size = rect ctx.restore() self.gc.ctx = ctx self.width, self.height = size