mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-07 20:54:28 +08:00
Change format_exception_only to work with exception value on first/second arg
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import sys
|
||||
from _typeshed import SupportsWrite
|
||||
from _typeshed import SupportsWrite, Unused
|
||||
from collections.abc import Generator, Iterable, Iterator, Mapping
|
||||
from types import FrameType, TracebackType
|
||||
from typing import Any, overload
|
||||
@@ -84,7 +84,10 @@ def format_list(extracted_list: list[FrameSummary]) -> list[str]: ...
|
||||
def print_list(extracted_list: list[FrameSummary], file: SupportsWrite[str] | None = None) -> None: ...
|
||||
|
||||
if sys.version_info >= (3, 10):
|
||||
def format_exception_only(__exc: type[BaseException] | None, value: BaseException | None = ...) -> list[str]: ...
|
||||
@overload
|
||||
def format_exception_only(__exc: BaseException | None) -> list[str]: ...
|
||||
@overload
|
||||
def format_exception_only(__exc: Unused, value: BaseException | None) -> list[str]: ...
|
||||
|
||||
else:
|
||||
def format_exception_only(etype: type[BaseException] | None, value: BaseException | None) -> list[str]: ...
|
||||
|
||||
Reference in New Issue
Block a user