Update OptionParser.{error,exit} to be NoReturn (#12464)

This commit is contained in:
Adam Turner
2024-07-31 12:20:56 +01:00
committed by GitHub
parent fa70187245
commit b6a142d6f5

View File

@@ -1,7 +1,7 @@
from _typeshed import Incomplete
from abc import abstractmethod
from collections.abc import Callable, Iterable, Mapping, Sequence
from typing import IO, Any, AnyStr, Literal, overload
from typing import IO, Any, AnyStr, Literal, NoReturn, overload
__all__ = [
"Option",
@@ -231,8 +231,8 @@ class OptionParser(OptionContainer):
def check_values(self, values: Values, args: list[str]) -> tuple[Values, list[str]]: ...
def disable_interspersed_args(self) -> None: ...
def enable_interspersed_args(self) -> None: ...
def error(self, msg: str) -> None: ...
def exit(self, status: int = 0, msg: str | None = None) -> None: ...
def error(self, msg: str) -> NoReturn: ...
def exit(self, status: int = 0, msg: str | None = None) -> NoReturn: ...
def expand_prog_name(self, s: str) -> str: ...
def format_epilog(self, formatter: HelpFormatter) -> str: ...
def format_help(self, formatter: HelpFormatter | None = None) -> str: ...