Improve many __(a)exit__ annotations (#9696)

This commit is contained in:
Avasam
2023-02-25 16:50:30 -05:00
committed by GitHub
parent db821101b8
commit 52ec44fa58
45 changed files with 216 additions and 81 deletions

View File

@@ -1,5 +1,7 @@
from distutils.errors import DistutilsError
from types import TracebackType
from typing import Any
from typing_extensions import Literal
class UnpickleableException(Exception):
@staticmethod
@@ -7,14 +9,18 @@ class UnpickleableException(Exception):
class ExceptionSaver:
def __enter__(self): ...
def __exit__(self, type, exc, tb): ...
def __exit__(
self, type: type[BaseException] | None, exc: BaseException | None, tb: TracebackType | None
) -> Literal[True] | None: ...
def resume(self) -> None: ...
def run_setup(setup_script, args): ...
class AbstractSandbox:
def __enter__(self) -> None: ...
def __exit__(self, exc_type, exc_value, traceback) -> None: ...
def __exit__(
self, exc_type: type[BaseException] | None, exc_value: BaseException | None, traceback: TracebackType | None
) -> None: ...
def run(self, func): ...
class DirectorySandbox(AbstractSandbox):