From 1b8b0602cba5a9a003563bfc21b1ba1c6ebd0cad Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Tue, 18 May 2021 16:37:26 -0400 Subject: [PATCH] Backport PR #20248: Replace pgf image-streaming warning by error. --- lib/matplotlib/backends/backend_pgf.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/matplotlib/backends/backend_pgf.py b/lib/matplotlib/backends/backend_pgf.py index 9d01f603e021..355090608c0c 100644 --- a/lib/matplotlib/backends/backend_pgf.py +++ b/lib/matplotlib/backends/backend_pgf.py @@ -635,9 +635,9 @@ def draw_image(self, gc, x, y, im, transform=None): return if not os.path.exists(getattr(self.fh, "name", "")): - _api.warn_external( + raise ValueError( "streamed pgf-code does not support raster graphics, consider " - "using the pgf-to-pdf option.") + "using the pgf-to-pdf option") # save the images to png files path = pathlib.Path(self.fh.name)