fix return type for traceback.format_exception (#326)

format_exception and format_exception_only both return lists of
strings, not strings.
This commit is contained in:
OrenLeaffer
2016-07-01 16:03:25 -07:00
committed by Guido van Rossum
parent ab08dbbf09
commit 998d787302
2 changed files with 4 additions and 4 deletions

View File

@@ -12,8 +12,8 @@ def print_stack(f: FrameType = ..., limit: int = ..., file: IO[AnyStr] = ...) ->
def extract_tb(f: TracebackType, limit: int = ...) -> ExtractTbResult: ...
def extract_stack(f: FrameType = ..., limit: int = ...) -> ExtractTbResult: ...
def format_list(list: ExtractTbResult) -> List[str]: ...
def format_exception_only(type: type, value: List[str]) -> str: ...
def format_exception(type: type, value: BaseException, tb: TracebackType, limit: int = ...) -> str: ...
def format_exception_only(type: type, value: List[str]) -> List[str]: ...
def format_exception(type: type, value: BaseException, tb: TracebackType, limit: int = ...) -> List[str]: ...
def format_tb(f: TracebackType, limit: int = ...) -> List[str]: ...
def format_stack(f: FrameType = ..., limit: int = ...) -> List[str]: ...
def tb_lineno(tb: TracebackType) -> AnyStr: ...

View File

@@ -5,8 +5,8 @@ from types import TracebackType
import typing
# TODO signatures
def format_exception_only(etype, value): ...
def format_exception(type: type, value: BaseException, tb: TracebackType, limit: int, chain: bool) -> str: ...
def format_exception_only(etype, value) -> List[str]: ...
def format_exception(type: type, value: BaseException, tb: TracebackType, limit: int, chain: bool) -> List[str]: ...
def format_tb(traceback): ...
def print_exc(limit=..., file=..., chain=...): ...
def format_exc(limit: int = ..., chain: bool = ...) -> str: ...