diff options
author | Guido van Rossum <guido@python.org> | 2015-10-19 21:55:47 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 2015-10-19 21:55:47 (GMT) |
commit | ca636eac88c2653fafedf063b7cac4924330e966 (patch) | |
tree | 96c015f3300cc5c19524d620444e2148ae2ad7b0 /Lib/typing.py | |
parent | 460b38151f4eb9302adac022166acadf6e4a221f (diff) | |
download | cpython-ca636eac88c2653fafedf063b7cac4924330e966.zip cpython-ca636eac88c2653fafedf063b7cac4924330e966.tar.gz cpython-ca636eac88c2653fafedf063b7cac4924330e966.tar.bz2 |
Issue #25390: typing: Don't crash on Union[str, Pattern].
Diffstat (limited to 'Lib/typing.py')
-rw-r--r-- | Lib/typing.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/Lib/typing.py b/Lib/typing.py index 1a4982e..d900036 100644 --- a/Lib/typing.py +++ b/Lib/typing.py @@ -487,6 +487,9 @@ class UnionMeta(TypingMeta): return Any if isinstance(t1, TypeVar): continue + if isinstance(t1, _TypeAlias): + # _TypeAlias is not a real class. + continue if any(issubclass(t1, t2) for t2 in all_params - {t1} if not isinstance(t2, TypeVar)): all_params.remove(t1) |