Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions sphinx/cmd/make_mode.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@
)
from sphinx.util.osutil import rmtree

try:
from contextlib import chdir # type: ignore[attr-defined]
except ImportError:
if sys.version_info >= (3, 11):
from contextlib import chdir
else:
from sphinx.util.osutil import _chdir as chdir

if TYPE_CHECKING:
Expand Down
7 changes: 4 additions & 3 deletions sphinx/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

from __future__ import annotations

import sys
import time
import traceback
import types
Expand All @@ -14,9 +15,9 @@
from sphinx.util.osutil import fs_encoding
from sphinx.util.typing import NoneType

try:
from contextlib import chdir # type: ignore[attr-defined]
except ImportError:
if sys.version_info >= (3, 11):
from contextlib import chdir
else:
from sphinx.util.osutil import _chdir as chdir

if TYPE_CHECKING:
Expand Down
6 changes: 3 additions & 3 deletions sphinx/util/typing.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
if TYPE_CHECKING:
import enum

try:
from types import UnionType # type: ignore[attr-defined] # python 3.10 or above
except ImportError:
if sys.version_info >= (3, 10):
from types import UnionType
else:
UnionType = None

# classes that have incorrect __module__
Expand Down