[traceback] Expose print_list method in traceback for python3. (#2837)

This commit is contained in:
Chen Li
2019-03-11 16:11:40 -07:00
committed by Sebastian Rittau
parent 34cc5545fe
commit 5918098576

View File

@@ -1,6 +1,6 @@
# Stubs for traceback
from typing import Any, Dict, Generator, IO, Iterator, List, Mapping, Optional, Tuple, Type, Iterable
from typing import Any, Dict, Generator, IO, Iterator, List, Mapping, Optional, Protocol, Tuple, Type, Iterable
from types import FrameType, TracebackType
import sys
@@ -36,6 +36,10 @@ if sys.version_info >= (3, 5):
def extract_stack(f: Optional[FrameType] = ...,
limit: Optional[int] = ...) -> StackSummary: ...
def format_list(extracted_list: List[FrameSummary]) -> List[str]: ...
class _Writer(Protocol):
def write(self, s: str) -> Any: ...
# undocumented
def print_list(extracted_list: List[FrameSummary], file: Optional[_Writer] = ...) -> None: ...
else:
def extract_tb(tb: Optional[TracebackType], limit: Optional[int] = ...) -> List[_PT]: ...
def extract_stack(f: Optional[FrameType] = ...,