From fb7bae8e42b13ec351ccbd9985a0e830c7e80db6 Mon Sep 17 00:00:00 2001 From: Adrian Vollmer Date: Sat, 30 Sep 2023 17:44:51 +0200 Subject: [PATCH] Fix compatibility with Sphinx >= 7.2; close #4 --- zundler/sphinxext/__init__.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/zundler/sphinxext/__init__.py b/zundler/sphinxext/__init__.py index 5533575..971d41c 100644 --- a/zundler/sphinxext/__init__.py +++ b/zundler/sphinxext/__init__.py @@ -67,8 +67,12 @@ def setup(app): 'doctree', ) app.original_outdir = app.outdir - app.outdir = outdir - app.doctreedir = doctreedir + + # Preserve types of app.outdir and app.doctreedir. + # Sphinx changed the types from str to Path around v7.2. + # This way it should be compatible with either way. + app.outdir = type(app.outdir)(outdir) + app.doctreedir = type(app.doctreedir)(doctreedir) Path(app.outdir).mkdir(parents=True, exist_ok=True) app.add_config_value(