Skip to content

Commit

Permalink
fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
danieleades committed Jul 27, 2024
1 parent 10378d8 commit 0634cce
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
12 changes: 9 additions & 3 deletions sphinx/application.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

import contextlib
import os
from pathlib import Path
import pickle
import sys
from collections import deque
Expand Down Expand Up @@ -42,6 +41,8 @@
from sphinx.util.tags import Tags

if TYPE_CHECKING:
from pathlib import Path

from docutils import nodes
from docutils.nodes import Element, Node
from docutils.parsers import Parser
Expand Down Expand Up @@ -453,12 +454,17 @@ def require_sphinx(version: tuple[int, int] | str) -> None:

# event interface
@overload
def connect(self, event: Literal['include-read'], callback: Callable[[Sphinx, Path, str, list[str]], None], priority: int = 500) -> int:
def connect(
self,
event: Literal['include-read'],
callback: Callable[[Sphinx, Path, str, list[str]], None],
priority: int = 500
) -> int:
...

@overload
def connect(self, event: str, callback: Callable, priority: int = 500) -> int: ...

def connect(self, event: str, callback: Callable, priority: int = 500) -> int:
"""Register *callback* to be called when *event* is emitted.
Expand Down
3 changes: 2 additions & 1 deletion sphinx/util/docfields.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
"""
from __future__ import annotations

from collections.abc import Sequence
import contextlib
from typing import TYPE_CHECKING, Any, cast

Expand All @@ -18,6 +17,8 @@
from sphinx.util.nodes import get_node_line

if TYPE_CHECKING:
from collections.abc import Sequence

from docutils.parsers.rst.states import Inliner

from sphinx.directives import ObjectDescription
Expand Down

0 comments on commit 0634cce

Please sign in to comment.