First argument to traceback.extract_tb can be None (#1223)

* First argument to traceback.extract_tb can be None

* Add Optional also to print_tb, format_tb, and walk_tb
This commit is contained in:
Ivan Levkivskyi
2017-04-27 17:07:40 +02:00
committed by Jelle Zijlstra
parent c05570cf00
commit c133a3aca7

View File

@@ -7,7 +7,7 @@ import sys
_PT = Tuple[str, int, str, Optional[str]]
def print_tb(tb: TracebackType, limit: Optional[int] = ...,
def print_tb(tb: Optional[TracebackType], limit: Optional[int] = ...,
file: Optional[IO[str]] = ...) -> None: ...
if sys.version_info >= (3,):
def print_exception(etype: Type[BaseException], value: BaseException,
@@ -28,7 +28,7 @@ else:
file: Optional[IO[str]] = ...) -> None: ...
def print_stack(f: Optional[FrameType] = ..., limit: Optional[int] = ...,
file: Optional[IO[str]] = ...) -> None: ...
def extract_tb(tb: TracebackType, limit: Optional[int] = ...) -> List[_PT]: ...
def extract_tb(tb: Optional[TracebackType], limit: Optional[int] = ...) -> List[_PT]: ...
def extract_stack(f: Optional[FrameType] = ...,
limit: Optional[int] = ...) -> List[_PT]: ...
def format_list(extracted_list: List[_PT]) -> List[str]: ...
@@ -44,14 +44,14 @@ else:
tb: TracebackType,
limit: Optional[int] = ...) -> List[str]: ...
def format_exc(limit: Optional[int] = ...) -> str: ...
def format_tb(tb: TracebackType, limit: Optional[int] = ...) -> List[str]: ...
def format_tb(tb: Optional[TracebackType], limit: Optional[int] = ...) -> List[str]: ...
def format_stack(f: Optional[FrameType] = ...,
limit: Optional[int] = ...) -> List[str]: ...
if sys.version_info >= (3, 4):
def clear_frames(tb: TracebackType) -> None: ...
if sys.version_info >= (3, 5):
def walk_stack(f: Optional[FrameType]) -> Iterator[Tuple[FrameType, int]]: ...
def walk_tb(tb: TracebackType) -> Iterator[Tuple[FrameType, int]]: ...
def walk_tb(tb: Optional[TracebackType]) -> Iterator[Tuple[FrameType, int]]: ...
if sys.version_info < (3,):
def tb_lineno(tb: TracebackType) -> int: ...