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

This commit is contained in:
Chen Li authored and Sebastian Rittau committed 2019-03-12 00:11:40 +01:00
1 parent 34cc5545fe
commit 5918098576
1 file changed
+5 -1
+5 -1
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] = ...,