From 7ecbc2c7e740672c17d6d11500d2ec573fed56d5 Mon Sep 17 00:00:00 2001 From: Adam Turner <9087854+aa-turner@users.noreply.github.com> Date: Mon, 14 Aug 2023 16:42:13 +0100 Subject: [PATCH] Use ``os.PathLike`` over ``pathlib.Path`` Sphinx 7.1 and earlier don't use ``pathlib`` internally. --- sphinxcontrib/devhelp/__init__.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/sphinxcontrib/devhelp/__init__.py b/sphinxcontrib/devhelp/__init__.py index 57e38c2..39946ab 100644 --- a/sphinxcontrib/devhelp/__init__.py +++ b/sphinxcontrib/devhelp/__init__.py @@ -6,9 +6,10 @@ from __future__ import annotations import gzip +import os import re from os import path -from typing import TYPE_CHECKING, Any +from typing import Any from docutils import nodes from sphinx import addnodes @@ -25,9 +26,6 @@ except ImportError: import lxml.etree as etree # type: ignore -if TYPE_CHECKING: - from pathlib import Path - __version__ = '1.0.4' __version_info__ = (1, 0, 4) @@ -64,7 +62,7 @@ def init(self) -> None: def handle_finish(self) -> None: self.build_devhelp(self.outdir, self.config.devhelp_basename) - def build_devhelp(self, outdir: Path, outname: str) -> None: + def build_devhelp(self, outdir: str | os.PathLike[str], outname: str) -> None: logger.info(__('dumping devhelp index...')) # Basic info