mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-01-22 19:13:34 +08:00
Improve many __(a)exit__ annotations (#9696)
This commit is contained in:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user