mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Resolve GitHub Actions failures
This commit is contained in:
parent
f8e8b4745e
commit
1de54e62bd
@ -126,7 +126,9 @@ if TYPE_CHECKING:
|
||||
@overload
|
||||
def __getitem__(self, key: str) -> Domain: ... # NoQA: E704
|
||||
def __getitem__(self, key): raise NotImplementedError # NoQA: E704
|
||||
def __setitem__(self, key: str, value: Domain) -> NoReturn: raise NotImplementedError # NoQA: E704
|
||||
def __setitem__(
|
||||
self, key: str, value: Domain,
|
||||
) -> NoReturn: raise NotImplementedError # NoQA: E704
|
||||
def __delitem__(self, key: str) -> NoReturn: raise NotImplementedError # NoQA: E704
|
||||
def __iter__(self) -> NoReturn: raise NotImplementedError # NoQA: E704
|
||||
def __len__(self) -> NoReturn: raise NotImplementedError # NoQA: E704
|
||||
|
@ -155,7 +155,7 @@ def init_console(
|
||||
locale_dir = _LOCALE_DIR
|
||||
try:
|
||||
# encoding is ignored
|
||||
language, _ = locale.getlocale(locale.LC_MESSAGES) # type: ignore[attr-defined]
|
||||
language, _ = locale.getlocale(locale.LC_MESSAGES)
|
||||
except AttributeError:
|
||||
# LC_MESSAGES is not always defined. Fallback to the default language
|
||||
# in case it is not.
|
||||
|
@ -22,7 +22,9 @@ _MSG = (
|
||||
|
||||
if sys.platform == 'win32':
|
||||
class _StrPath(WindowsPath):
|
||||
def replace(self, old: str, new: str, count: int = -1, /) -> str: # type: ignore[override]
|
||||
def replace( # type: ignore[override]
|
||||
self, old: str, new: str, count: int = -1, /,
|
||||
) -> str:
|
||||
# replace exists in both Path and str;
|
||||
# in Path it makes filesystem changes, so we use the safer str version
|
||||
warnings.warn(_MSG, RemovedInSphinx80Warning, stacklevel=2)
|
||||
@ -69,7 +71,9 @@ if sys.platform == 'win32':
|
||||
return len(self.__str__())
|
||||
else:
|
||||
class _StrPath(PosixPath):
|
||||
def replace(self, old: str, new: str, count: int = -1, /) -> str: # type: ignore[override]
|
||||
def replace( # type: ignore[override]
|
||||
self, old: str, new: str, count: int = -1, /,
|
||||
) -> str:
|
||||
# replace exists in both Path and str;
|
||||
# in Path it makes filesystem changes, so we use the safer str version
|
||||
warnings.warn(_MSG, RemovedInSphinx80Warning, stacklevel=2)
|
||||
@ -96,7 +100,7 @@ else:
|
||||
warnings.warn(_MSG, RemovedInSphinx80Warning, stacklevel=2)
|
||||
return item in self.__str__()
|
||||
|
||||
def __eq__(self, other: PurePath | str) -> bool:
|
||||
def __eq__(self, other: object) -> bool:
|
||||
if isinstance(other, PurePath):
|
||||
return super().__eq__(other)
|
||||
if isinstance(other, str):
|
||||
|
Loading…
Reference in New Issue
Block a user