Skip to content

Commit b6a142d

Browse files
authored
Update OptionParser.{error,exit} to be NoReturn (#12464)
1 parent fa70187 commit b6a142d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

stdlib/optparse.pyi

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from _typeshed import Incomplete
22
from abc import abstractmethod
33
from collections.abc import Callable, Iterable, Mapping, Sequence
4-
from typing import IO, Any, AnyStr, Literal, overload
4+
from typing import IO, Any, AnyStr, Literal, NoReturn, overload
55

66
__all__ = [
77
"Option",
@@ -231,8 +231,8 @@ class OptionParser(OptionContainer):
231231
def check_values(self, values: Values, args: list[str]) -> tuple[Values, list[str]]: ...
232232
def disable_interspersed_args(self) -> None: ...
233233
def enable_interspersed_args(self) -> None: ...
234-
def error(self, msg: str) -> None: ...
235-
def exit(self, status: int = 0, msg: str | None = None) -> None: ...
234+
def error(self, msg: str) -> NoReturn: ...
235+
def exit(self, status: int = 0, msg: str | None = None) -> NoReturn: ...
236236
def expand_prog_name(self, s: str) -> str: ...
237237
def format_epilog(self, formatter: HelpFormatter) -> str: ...
238238
def format_help(self, formatter: HelpFormatter | None = None) -> str: ...

0 commit comments

Comments
 (0)