From 92849a82b1051d6cd15ac1e49d2ab48555c239c8 Mon Sep 17 00:00:00 2001 From: Daniel McCloy Date: Mon, 2 Oct 2023 23:05:41 +0300 Subject: [PATCH] fix bug, remove crufty var, add func docstring --- doc/conf.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/conf.py b/doc/conf.py index ad60ffa03f5..90af2e0c1cd 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -1696,6 +1696,7 @@ def reset_warnings(gallery_conf, fname): def check_existing_redirect(path): + """Make sure existing HTML files are redirects, before overwriting.""" if os.path.isfile(path): with open(path, "r") as fid: for _ in range(8): @@ -1755,7 +1756,7 @@ def make_redirects(app, exception): ) # API redirects for page in api_redirects: - fname = f"{fname}.html" + fname = f"{page}.html" fr_path = os.path.join(app.outdir, fname) to_path = os.path.join(app.outdir, "api", fname) # allow overwrite if existing file is just a redirect @@ -1798,7 +1799,6 @@ def make_version(app, exception): and exception is None ): return - logger = sphinx.util.logging.getLogger("mne") try: stdout, _ = run_subprocess(["git", "rev-parse", "HEAD"], verbose=False) except Exception as exc: