-
-
Notifications
You must be signed in to change notification settings - Fork 397
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(debugger): simplify PDBProtocol and remove unused protocol c…
…lasses
- Loading branch information
Alexandr Panteleev
committed
Feb 7, 2025
1 parent
fee80dc
commit 0dfd519
Showing
1 changed file
with
5 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,16 @@ | ||
from types import ModuleType, TracebackType | ||
from typing import NoReturn, Optional, Protocol, Type, Union | ||
from typing import Any, Optional, Protocol, Union | ||
|
||
from typing_extensions import TypeAlias | ||
|
||
|
||
class PDBProtocol(Protocol): | ||
@staticmethod | ||
def post_mortem( | ||
t: Optional[TracebackType] = None, | ||
) -> Optional[NoReturn]: ... | ||
|
||
|
||
class IPDBProtocol(Protocol): | ||
@staticmethod | ||
def post_mortem( | ||
tb: Optional[TracebackType] = None, | ||
) -> Optional[NoReturn]: ... | ||
|
||
|
||
class PDBRProtocol(Protocol): | ||
@staticmethod | ||
def post_mortem( | ||
traceback: Optional[TracebackType] = None, | ||
value: Optional[BaseException] = None, | ||
) -> Optional[NoReturn]: ... | ||
|
||
|
||
class PUDBProtocol(Protocol): | ||
@staticmethod | ||
def post_mortem( | ||
tb: Optional[TracebackType] = None, | ||
e_type: Optional[Type[BaseException]] = None, | ||
e_value: Optional[BaseException] = None, | ||
) -> Optional[NoReturn]: ... | ||
*args: Any, | ||
**kwargs: Any, | ||
) -> Any: ... | ||
|
||
|
||
Debugger: TypeAlias = Union[ModuleType, PDBProtocol, IPDBProtocol, PDBRProtocol, PUDBProtocol] | ||
Debugger: TypeAlias = Union[ModuleType, PDBProtocol] |