mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Remove deprecated functions in `sphinx.util.osutil
`
This commit is contained in:
parent
35a0f7386b
commit
7225e4032a
@ -33,6 +33,9 @@ Incompatible changes
|
|||||||
(use ``sphinx.builders.epub3._XML_NAME_PATTERN``).
|
(use ``sphinx.builders.epub3._XML_NAME_PATTERN``).
|
||||||
|
|
||||||
Patch by Adam Turner.
|
Patch by Adam Turner.
|
||||||
|
* Removed :py:func:`!sphinx.util.osutil.cd`
|
||||||
|
(use :py:func:`contextlib.chdir`).
|
||||||
|
Patch by Adam Turner.
|
||||||
|
|
||||||
Deprecated
|
Deprecated
|
||||||
----------
|
----------
|
||||||
|
@ -13,8 +13,6 @@ from io import StringIO
|
|||||||
from os import path
|
from os import path
|
||||||
from typing import TYPE_CHECKING
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from sphinx.deprecation import _deprecation_warning
|
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
from collections.abc import Iterator
|
from collections.abc import Iterator
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
@ -183,12 +181,8 @@ class _chdir:
|
|||||||
os.chdir(self._dirs.pop())
|
os.chdir(self._dirs.pop())
|
||||||
|
|
||||||
|
|
||||||
@contextlib.contextmanager
|
if sys.version_info[:2] < (3, 11):
|
||||||
def cd(target_dir: str) -> Iterator[None]:
|
cd = _chdir
|
||||||
if sys.version_info[:2] >= (3, 11):
|
|
||||||
_deprecation_warning(__name__, 'cd', 'contextlib.chdir', remove=(8, 0))
|
|
||||||
with _chdir(target_dir):
|
|
||||||
yield
|
|
||||||
|
|
||||||
|
|
||||||
class FileAvoidWrite:
|
class FileAvoidWrite:
|
||||||
|
Loading…
Reference in New Issue
Block a user