diff --git a/lib/matplotlib/backends/backend_cairo.py b/lib/matplotlib/backends/backend_cairo.py index c733f3f9d3d7..421d857b0a03 100644 --- a/lib/matplotlib/backends/backend_cairo.py +++ b/lib/matplotlib/backends/backend_cairo.py @@ -95,7 +95,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