mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
bpo-34921: Allow escaped NoReturn in get_type_hints (GH-9750)
This commit is contained in:
parent
4c33997057
commit
5eea0ad50c
1 changed files with 1 additions and 1 deletions
|
@ -130,7 +130,7 @@ def _type_check(arg, msg, is_argument=True):
|
|||
if (isinstance(arg, _GenericAlias) and
|
||||
arg.__origin__ in invalid_generic_forms):
|
||||
raise TypeError(f"{arg} is not valid as type argument")
|
||||
if (isinstance(arg, _SpecialForm) and arg is not Any or
|
||||
if (isinstance(arg, _SpecialForm) and arg not in (Any, NoReturn) or
|
||||
arg in (Generic, _Protocol)):
|
||||
raise TypeError(f"Plain {arg} is not valid as type argument")
|
||||
if isinstance(arg, (type, TypeVar, ForwardRef)):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue