From 62ba0ae0f6111f4ff8563bc34bcf134c48fbe887 Mon Sep 17 00:00:00 2001 From: "Albert Y. Shih" Date: Wed, 9 Aug 2023 20:27:40 -0400 Subject: [PATCH] Accommodate newer Sphinx versions that use pathlib --- sphinx_automodapi/automodsumm.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sphinx_automodapi/automodsumm.py b/sphinx_automodapi/automodsumm.py index 10a71f6..06054ae 100644 --- a/sphinx_automodapi/automodsumm.py +++ b/sphinx_automodapi/automodsumm.py @@ -635,7 +635,7 @@ def get_members_class(obj, typ, include_public=[], # An important subtlety here is that the path we pass in has # to be relative to the file being generated, so we have to # figure out the right number of '..'s - ndirsback = path.replace(base_path, '').count(os.sep) + ndirsback = path.replace(str(base_path), '').count(os.sep) ref_file_rel_segments = ['..'] * ndirsback ref_file_rel_segments.append(mod_name_dir) ref_file_rel_segments.append('references.txt')