From c97f6db8c4296754619a8c42b0cc615c917d5dc3 Mon Sep 17 00:00:00 2001 From: Mecoli1219 Date: Fri, 15 Nov 2024 07:40:35 -0800 Subject: [PATCH] fix buf Signed-off-by: Mecoli1219 --- docs/_ext/notebook_literalinclude.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/docs/_ext/notebook_literalinclude.py b/docs/_ext/notebook_literalinclude.py index a44320f651..bf196dea21 100644 --- a/docs/_ext/notebook_literalinclude.py +++ b/docs/_ext/notebook_literalinclude.py @@ -1,9 +1,10 @@ import json +import os from docutils import nodes from docutils.parsers.rst import directives from six import text_type -from typing import Any, Dict, List, Tuple, TYPE_CHECKING +from typing import Any, Dict, List, Tuple, TYPE_CHECKING, Union from sphinx.application import Sphinx from sphinx.config import Config @@ -14,19 +15,19 @@ from sphinx.util.nodes import set_source_info from sphinx.util._pathlib import _StrPath -if TYPE_CHECKING: - import os - class NotebookLiteralIncludeReader(object): def __init__( - self, filename: str | os.PathLike[str], options: Dict[str, Any], config: Config + self, + filename: Union[str, os.PathLike[str]], + options: Dict[str, Any], + config: Config, ) -> None: self.filename = _StrPath(filename) self.options = options - def read_file(self, filename: str | os.PathLike[str]) -> List[str]: + def read_file(self, filename: Union[str, os.PathLike[str]]) -> List[str]: filename = _StrPath(filename) json_data = json.loads(filename.read_text())