Skip to content

Commit

Permalink
mark sys.UnraisableHookArgs as type_check_only (python#13077)
Browse files Browse the repository at this point in the history
mark sys.UnraisableHookArgs as type_check_only
  • Loading branch information
tungol authored Nov 23, 2024
1 parent ff75709 commit ba9116c
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 1 deletion.
1 change: 0 additions & 1 deletion stdlib/@tests/stubtest_allowlists/common.txt
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ socketserver.BaseServer.fileno # implemented in derived classes
socketserver.BaseServer.get_request # implemented in derived classes
socketserver.BaseServer.server_bind # implemented in derived classes
ssl.Purpose.__new__ # the multiple inheritance confuses mypy
sys.UnraisableHookArgs # Not exported from sys
tarfile.TarFile.errors # errors is initialized for some reason as None even though it really only accepts str
tkinter.simpledialog.[A-Z_]+
tkinter.simpledialog.TclVersion
Expand Down
1 change: 1 addition & 0 deletions stdlib/sys/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -415,6 +415,7 @@ if sys.version_info < (3, 9):
def callstats() -> tuple[int, int, int, int, int, int, int, int, int, int, int] | None: ...

# Doesn't exist at runtime, but exported in the stubs so pytest etc. can annotate their code more easily.
@type_check_only
class UnraisableHookArgs(Protocol):
exc_type: type[BaseException]
exc_value: BaseException | None
Expand Down

0 comments on commit ba9116c

Please sign in to comment.