traceback: use StackSummary where possible (#1495)

This commit is contained in:
Luka Sterbic
2017-07-26 16:27:43 +01:00
committed by Jelle Zijlstra
parent 1e04a8c1b8
commit 34c8aa0d4c

View File

@@ -28,10 +28,17 @@ else:
file: Optional[IO[str]] = ...) -> None: ...
def print_stack(f: Optional[FrameType] = ..., limit: Optional[int] = ...,
file: Optional[IO[str]] = ...) -> None: ...
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]: ...
if sys.version_info >= (3, 5):
def extract_tb(tb: Optional[TracebackType], limit: Optional[int] = ...) -> StackSummary: ...
def extract_stack(f: Optional[FrameType] = ...,
limit: Optional[int] = ...) -> StackSummary: ...
def format_list(extracted_list: List[FrameSummary]) -> List[str]: ...
else:
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]: ...
def format_exception_only(etype: Type[BaseException],
value: BaseException) -> List[str]: ...
if sys.version_info >= (3,):
@@ -82,7 +89,13 @@ if sys.version_info >= (3, 5):
if sys.version_info >= (3, 5):
class StackSummary:
class FrameSummary:
def __init__(self, filename: str, lineno: int, name: str,
lookup_line: bool = ...,
locals: Optional[Mapping[str, str]] = ...,
line: Optional[int] = ...) -> None: ...
class StackSummary(List[FrameSummary]):
@classmethod
def extract(cls,
frame_gen: Generator[Tuple[FrameType, int], None, None],
@@ -90,11 +103,3 @@ if sys.version_info >= (3, 5):
capture_locals: bool = ...) -> StackSummary: ...
@classmethod
def from_list(cls, a_list: List[_PT]) -> StackSummary: ...
if sys.version_info >= (3, 5):
class FrameSummary:
def __init__(self, filename: str, lineno: int, name: str,
lookup_line: bool = ...,
locals: Optional[Mapping[str, str]] = ...,
line: Optional[int] = ...) -> None: ...