From 9c6f3bb8c38e481309ff485b1647511b068bc193 Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Tue, 27 Jul 2021 18:13:25 -0400 Subject: [PATCH] Ensure _static directory exists before copying CSS. Fixes #20747. --- lib/matplotlib/sphinxext/plot_directive.py | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/matplotlib/sphinxext/plot_directive.py b/lib/matplotlib/sphinxext/plot_directive.py index d59d9bdd71bf..d40e0c58b4a5 100644 --- a/lib/matplotlib/sphinxext/plot_directive.py +++ b/lib/matplotlib/sphinxext/plot_directive.py @@ -266,6 +266,7 @@ def _copy_css_file(app, exc): if exc is None and app.builder.format == 'html': src = cbook._get_data_path('plot_directive/plot_directive.css') dst = app.outdir / Path('_static') + dst.mkdir(exist_ok=True) shutil.copy(src, dst)